From 5a584bfafae7263878a42e1c841ff6e537b7cf32 Mon Sep 17 00:00:00 2001 From: cfdaily Date: Tue, 26 May 2026 12:58:03 +0800 Subject: [PATCH] auto-sync: 2026-05-26 12:58:03 --- src/daemon/spawner.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/daemon/spawner.py b/src/daemon/spawner.py index a27a401..3512f30 100644 --- a/src/daemon/spawner.py +++ b/src/daemon/spawner.py @@ -1037,8 +1037,13 @@ 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 等 + # openclaw agent 正常退出一定会输出 JSON。stdout 为空 = 进程被异常终止(kill/崩溃) + # stdout 为空时不应续杯,应等 ticker if exit_code == 0 and not is_terminal: + stdout_is_empty = not stdout_text or not stdout_text.strip() + if stdout_is_empty: + # 进程异常终止(没有正常输出 JSON),不续杯 + return {"outcome": "agent_error", "should_retry": False} # P2: transport=null 时检查 stderr 辅助判断 if not transport: stderr_lower = stderr_text.lower()