fix(spawner): §24 compact check must run when status=done (compact in progress)
CI / lint (pull_request) Successful in 7s
CI / test (pull_request) Successful in 9s
CI / notify-on-failure (pull_request) Successful in 0s

This commit is contained in:
cfdaily
2026-06-11 21:18:11 +08:00
parent 7918b12ff7
commit caf750fad6
+3 -3
View File
@@ -1497,9 +1497,9 @@ curl -X POST http://{api_host}:{api_port}/api/projects/{project_id}/tasks/{task_
# §24 v3: compact 检测优先用 gateway 日志 rotation 事件
# 旧方法 _check_recent_compaction_jsonl 作为 fallback
# 只在 agent 非空闲时才检查(减少不必要 I/O)
if result["status"] not in (
"done", "idle", "unknown", None):
# 重要:compact 进行中时 status=done,所以不能按 status 过滤
# 只跳过 idle/unknown(完全没有活动过的 session)
if result["status"] not in ("idle", "unknown", None):
session_key = f"agent:{agent_id}:main"
result["recent_compact"] = AgentSpawner._check_compact_in_progress_gateway(
session_key)