From bd664c1701706cbc655074d6e83de7ce88bdc91d Mon Sep 17 00:00:00 2001 From: cfdaily Date: Tue, 26 May 2026 10:48:44 +0800 Subject: [PATCH] auto-sync: 2026-05-26 10:48:44 --- src/daemon/spawner.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/daemon/spawner.py b/src/daemon/spawner.py index 87c7cf4..ef108e9 100644 --- a/src/daemon/spawner.py +++ b/src/daemon/spawner.py @@ -987,7 +987,17 @@ curl -X POST http://{api_host}:{api_port}/api/projects/{project_id}/tasks/{task_ return {"outcome": "fallback_timeout", "should_retry": False} # A2/A3: Gateway timeout(任务没完成)— 唯一续杯场景 + # P2 兜底:如果 transport 仍为空(解析失败),检查 stderr 判断是否是 lock/compact 等 if exit_code == 0 and not is_terminal: + # P2: transport=null 时检查 stderr 辅助判断 + if not transport: + stderr_lower = stderr_text.lower() + if any(kw in stderr_lower for kw in ["lock", "busy", "concurrent", "lane task error"]): + return {"outcome": "lock_conflict", "should_retry": False} + if any(kw in stderr_lower for kw in ["compaction-diag", "context-overflow"]): + return {"outcome": "compact_failed", "should_retry": False} + if any(kw in stderr_lower for kw in ["rate_limit", "500", "503"]): + return {"outcome": "api_error", "should_retry": False} return {"outcome": "gateway_timeout", "should_retry": True, "retry_field": "retry_count"}