fix: 收敛公共 trace result 契约

This commit is contained in:
Codex Agent
2026-06-06 14:20:57 +08:00
parent 494d3ed3bb
commit c58a7fff6c
5 changed files with 26 additions and 2 deletions
@@ -46,6 +46,8 @@
5. 写回内存缓存和 session 派生证据时,只能写刚由 command result 生成的 payload;旧 `finalResponse`、旧 `traceSummary` 和旧 `traceResults` 不得参与 merge 覆盖。
6. 如果 command registry 找不到该 `traceId` 对应 command,返回结构化错误,例如 `agentrun_trace_command_not_found`;不得回退到旧缓存、top-level snapshot、latest trace 或其他 command result。
Completed result 响应必须把 AgentRun command result 的终态证据公开为 `terminalEvidence`,并与 `agentRun.commandId``finalResponse.traceId` 保持一致。`/result``/trace` 响应不得导出 `fallback` 字段;降级、缺失或过期只能用 `status``traceStatus``retention``error``terminalEvidence` 表达,避免旧 fallback contract 重新成为并行 final response 路径。
Running 轮询可以返回 `202` 和当前 runnerTrace;这只是“尚未 terminal”的轮询语义,不是 final fallback。Completed / failed / canceled / blocked 等 terminal 状态必须经过同一 command registry/result 路径确认。
## Trace 读取与渲染流程