fix: 收敛 queue runner 失败终态与 CLI 生命周期

This commit is contained in:
Codex
2026-06-01 23:33:08 +08:00
parent b19143ad85
commit 5104d402c7
6 changed files with 196 additions and 9 deletions
+3 -1
View File
@@ -73,6 +73,7 @@ CLI 交互联调必须满足:
- CLI 输出、日志摘要和错误信息必须保留可观测性,不能只返回成功/失败布尔值;错误必须能区分 missing SecretRef、provider auth failure、runner lease conflict、backend failure 和 infra failure。
- CLI 不得输出 provider credential、Postgres DSN password、token、URL credential 或 Secret value;只能输出 redacted value 或 SecretRef。
- 重启或滚动 `agentrun-mgr` 后,CLI 仍能查询同一 run、command、events 和 terminal_status,证明结果来自 Postgres 而不是进程内存。
- 本地临时 manager 验收必须使用 `server start/status/stop` 生命周期命令管理进程。不得把长驻前台 `server start` 留给 SSH/tran 顶层超时清理;若需要前台模式,必须显式 `--foreground` 并在同一终端可控结束。
### RESTful API 交互联调标准
@@ -187,7 +188,7 @@ T8 是涉及 backend profile 变更时的综合联调标准;不涉及 backend
### T11 Queue 吸收 Code Queue 手动验收
阅读本文和 [spec-v01-queue.md](spec-v01-queue.md),然后在真实 `agentrun-v01` runtime 中用正式 CLI 手动验证 Queue 首版闭环:创建 Queue task,轮询 `queue list/show/stats/commander/read`,触发真实 Codex/Codex-compatible attempt 到 terminal确认 `queue show` 返回 `sessionPath`,再通过 `sessions output/trace` 查询输出和 trace。该验收不得使用 mock,不写自动交互脚本,不做 Web/Playwright。确认 Queue overview、stats、read 和 commander 均来自 Queue summary/stats/read 模型,不从 Core trace 或 Session trace 反推;确认不存在首版 OA/Event/OA sink/integrations/notification/GitHub sink 依赖;确认 MiniMax/OpenCode 不作为 Queue 首版能力;确认旧 UniDesk Code Queue 不接收新任务且历史数据不迁移到 AgentRun。
阅读本文和 [spec-v01-queue.md](spec-v01-queue.md),然后在真实 `agentrun-v01` runtime 中用正式 CLI 手动验证 Queue 首版闭环:创建 Queue task,轮询 `queue list/show/stats/commander/read``queue dispatch` 触发真实 Codex/Codex-compatible attempt 到 terminal再用 `queue refresh` 从 Core run/command 终态回写 Queue task/latestAttempt。确认 `queue show` 返回 `sessionPath`,输出和 trace 只通过 Session API/CLI 查询。该验收不得使用 mock,不写自动交互脚本,不做 Web/Playwright。确认 Queue overview、stats、read 和 commander 均来自 Queue summary/stats/read 模型,不从 Core trace 或 Session trace 反推;确认不存在首版 OA/Event/OA sink/integrations/notification/GitHub sink 依赖;确认 MiniMax/OpenCode 不作为 Queue 首版能力;确认旧 UniDesk Code Queue 不接收新任务且历史数据不迁移到 AgentRun。若使用 `host-path` workspace,必须先证明该路径在 runner 运行面可访问且不会破坏 backend command resolution;否则应使用 `opaque` 或 Git-only ResourceBundleRef 做 Queue dispatch 最小验收。
## 规格的实现情况
@@ -204,4 +205,5 @@ T8 是涉及 backend profile 变更时的综合联调标准;不涉及 backend
| RuntimeAssembly 四要素验收 | 已定义 | T9 收敛为四个最简问题:image digest、profile/SecretRef、session null/deferred、Git-only repo/full commitsession/resource materialization 后续实现时必须补真实联调。 |
| HWLAB 手动调度 canary 验收 | 已定义 | T10 规定 HWLAB dispatcher 通过手动 runner Job API 使用 AgentRun 的真实联调口径;自动 scheduler 不是前置条件。 |
| Queue 吸收 Code Queue 验收 | 已定义 | T11 规定 Queue RESTful/CLI/Session 分层的真实手动交互验收;mock 只允许在自测试层。 |
| Queue Q2 受控 dispatch/refresh 主闭环 | 已通过 | 已在真实 `agentrun-v01` Postgres 与 G14 k3s runner Job 上完成正式 CLI 手动验收;通过样本使用 `opaque` workspace 完成 Codex stdio turn`queue refresh` 后 Queue task/latestAttempt 为 completed。 |
| mock 作为发布证据 | 不采用 | mock 只能证明自测试通过。 |