fix: prevent false timeout failures and release 1.2.2

This commit is contained in:
chenmingxuan committed 2026-09-28 19:11:16 +08:00
1 parent 1dc2b0c686
commit e1e26772d9
18 files changed
+189 -22

No files matched your search

+12 -2
View File
@@ -151,6 +151,7 @@ class VisualStepSummarizer(StepMemoryService):
ctx: ArtemisContext,
model_name: str | None = None,
retry_limit: int = 3,
timeout_seconds: float = 25.0,
*,
max_concurrency: int = 1,
flush_timeout_s: float = 30.0,
@@ -161,6 +162,7 @@ class VisualStepSummarizer(StepMemoryService):
retry_limit=retry_limit,
flush_timeout_s=flush_timeout_s,
)
self._timeout_seconds = timeout_seconds
# Initialize lightweight VLM: prioritize explicit model_name
target_model = model_name or settings.OPENAI_MODEL
@@ -459,7 +461,9 @@ class VisualStepSummarizer(StepMemoryService):
HumanMessage(content=content_blocks),
]
response = await asyncio.wait_for(self._llm.ainvoke(messages), timeout=25.0)
response = await asyncio.wait_for(
self._llm.ainvoke(messages), timeout=self._timeout_seconds
)
self._meter_lens_call(response)
summary_raw = response.content if isinstance(response.content, str) else ""
if isinstance(response.content, list):
@@ -505,8 +509,14 @@ class VisualStepSummarizer(StepMemoryService):
logger.debug(f"DataEngine step summary update skipped: {de_err}")
return True
except TimeoutError:
logger.warning(
f"VisualStepSummarizer: Step {step_number} summary request timed out "
f"(limit {self._timeout_seconds:.1f}s)"
)
except Exception as e:
logger.warning(
f"VisualStepSummarizer: Error generating summary for step {step_number}: {e}"
f"VisualStepSummarizer: Error generating summary for step {step_number}: "
f"{type(e).__name__}: {e}"
)
return False