fix: improve cross-device evidence and exploration lifecycle

Align Responses cache affinity across execution and summary calls, preserve required checks and evidence uncertainty, and allow safe deletion of inactive explorations while retaining independent reruns.

Validation: backend suite passed except intentional prompt golden drift, then all 17 transcript tests passed after snapshot refresh; 268 frontend tests and production build passed; Ruff, quality ratchet and core type checks passed.
This commit is contained in:
chenmingxuan committed 2026-10-17 19:43:20 +08:00
1 parent f1bb5d02aa
commit 2328a4df0c
32 files changed
+748 -79

No files matched your search

+9 -1
View File
@@ -504,8 +504,16 @@ class StepCapsuleLens(StepLens):
return parsed
async def _invoke(self, llm: Any, messages: list[BaseMessage], model_label: str):
from artemis.llm.cache_affinity import cache_affinity_options
request_messages = adapt_responses_messages(messages, model_label)
response = await asyncio.wait_for(llm.ainvoke(request_messages), timeout=90.0)
response = await asyncio.wait_for(
llm.ainvoke(
request_messages,
**cache_affinity_options(self._ctx, "lens:step_capsule", model_label),
),
timeout=90.0,
)
# Raw-model bypass metering (gateway-wrapped models meter themselves);
# capsule prompts are small and are kept out of the session meter's
# last_prompt_tokens (the compaction base itself is operator-owned on