goal 异常退出记 interrupted,可断点续跑

长 goal 实弹(2026-10-28):宿主机内存挤兑致回合挂起 59 分钟,恢复时 goal 进程异常退出、无结论行,云端旧语义(returncode 非 0 一律 failed)把可续跑的断点判成终局。

修法:host.py run_goal_loop 回合异常统一记 interrupted 并打印 goal interrupted after rounds 标记行;cloud/sandbox.py 四处 goal 解析同步新语义(标记或无结论非 0 退出 -> interrupted,有结论的非 0 退出仍 failed);worker 终局审计名与状态对齐。单测:sandbox 新测 5 个、host 新测 1 个、更新旧测 1 个;三套件 cloud 1017、host 61、deploy 29 全绿。只本地提交,未推未部署。
This commit is contained in:
host committed 2026-10-28 15:18:26 +08:00
1 parent d129f7bf8c
commit 94137c4a29
6 files changed
+287 -29

No files matched your search

+6
View File
@@ -3770,13 +3770,19 @@ class Worker:
cost_id = self._record_usage_cost(
task, actual_model, usage_total, stdout, fallback_count)
if final_written:
# 审计名须与终态一致:interrupted 任务记 worker_failed
# 会把“可续跑的中断”误读成失败,误导后续排查。
self._audit(task["project_id"],
"worker_quota_stop" if quota_stop else
("worker_completed" if final == "completed"
else "worker_interrupted"
if final == "interrupted"
else "worker_failed"), task_id)
log_event(self.logger,
"worker_quota_stop" if quota_stop else
("worker_completed" if final == "completed"
else "worker_interrupted"
if final == "interrupted"
else "worker_failed"),
task_id=task_id, project_id=task["project_id"],
status=final)