docs: record agentrun lane observability

This commit is contained in:
Codex
2026-06-20 09:47:37 +00:00
parent 2a82e2972c
commit a2ec41cc63
3 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -145,7 +145,7 @@ AgentRun `v0.1` 的指挥官任务面已经按 AgentRun issue #105 完成真实
UniDesk 指挥官新任务入口固定使用 `bun scripts/cli.ts agentrun get|describe|events|logs|result|ack|cancel|dispatch|create|apply|steer|send` 资源原语。该入口是 render-only clientUniDesk 客户端保留 k8s 风格命令解析、human 表格、生命周期摘要、下一步命令、分页、`-o json|yaml` 稳定客户端 schema 和错误展示;AgentRun 服务端只提供稳定 RESTful API、鉴权和业务事实,不承载 UniDesk CLI 渲染。日常派单优先用 `agentrun create task --aipod Artificer --prompt-stdin``agentrun apply -f -` 的 quoted YAML/JSON heredoc/stdin 形式;已创建未运行任务用 `agentrun dispatch task/<taskId>` 派发;`--json-file``--prompt-file``--runner-json-file` 只是客户端输入来源,用于已审阅且可复用的受控文件。UniDesk 不实现 AgentRun queue 协议,也不把任务 double-write 回旧 Code Queue。
资源原语和旧兼容 group 的默认 transport 是直连 AgentRun REST API,配置来源是 UniDesk 自有 YAML `config/agentrun.yaml`。鉴权可以复用 `HWLAB_API_KEY` 的环境变量/固定文件发现风格,但不得依赖 HWLAB runtime、HWLAB backend-core、HWLAB frontend 代理或 SSH official CLI;多一层转发会增加故障面,不能作为正式路径。`--raw` 只披露直连 AgentRun REST envelope 和必要的 `transport=direct-http``clientRole=render-only``configPath``baseUrl`、auth source/redacted metadata,不打印 token value。`agentrun control-plane ...``git-mirror ...` 仍属于 G14 source/runtime 运维控制路径,可以继续使用 UniDesk SSH capture bridge;这些控制面路径不得反向成为 queue/session 资源原语的默认 transport。
资源原语和旧兼容 group 的默认 transport 是直连 AgentRun REST API,配置来源是 UniDesk 自有 YAML `config/agentrun.yaml`不带 `--node`/`--lane` 时按 YAML 的默认 manager `baseUrl` 访问;显式 `--node <node> --lane <lane>` 时按同一 YAML 选中 runtime lane,经 `lane-k8s-service-proxy` 进入 manager `internalBaseUrl`,并用 manager pod env 中声明的 API key metadata 发起请求;输出只披露 node/lane/namespace/baseUrl/auth env metadata 和 `valuesPrinted=false`,不得打印 key value。该模式用于 D601 `agentrun-v02` 等非默认 lane 的资源原语操作与证据采集,尤其是 `get/describe/events/logs/result`,不替代 `agentrun control-plane ...` 发布或运维控制。鉴权可以复用 `HWLAB_API_KEY` 的环境变量/固定文件发现风格,但不得依赖 HWLAB runtime、HWLAB backend-core、HWLAB frontend 代理或 SSH official CLI;多一层转发会增加故障面,不能作为正式路径。`--raw` 只披露直连 AgentRun REST envelope 和必要的 `transport=direct-http``clientRole=render-only``configPath``baseUrl`、auth source/redacted metadata,不打印 token value。`agentrun control-plane ...``git-mirror ...` 仍属于 G14 source/runtime 运维控制路径,可以继续使用 UniDesk SSH capture bridge;这些控制面路径不得反向成为 queue/session 资源原语的默认 transport。
AgentRun 公网 HTTPS 入口、FRP/Caddy edge、direct REST base URL 和鉴权来源都由 UniDesk `config/agentrun.yaml` 声明。YAML-only lane 不允许把这些部署选择写回 AgentRun source branch 的 `deploy/deploy.json`AgentRun source repo 只保留应用代码、构建输入和 repo 内部实现文档。`bun scripts/cli.ts agentrun control-plane expose --confirm` 只负责按 UniDesk YAML 补 edge 侧 allow port 与 Caddy site,不在 AgentRun k3s 中创建 Ingress、NodePort、LoadBalancer、hostPort 或 HWLAB 转发层。
@@ -179,7 +179,7 @@ AgentRun runner-side instrumentation 必须从 manager 创建 runner Job 时传
codex app-server backend 的最小可追踪面包括 app-server lifecycle、thread、turn、tool、idle 和 provider stream 断开:`codex_app_server.starting``codex_app_server.started`、进程退出时的 `codex_app_server.exit`,以及 `codex_stdio.thread_start.*` / `codex_stdio.thread_resume.*``codex_stdio.turn_start.*``codex_stdio.tool_call.started|completed|failed``codex_stdio.turn_completed``codex_stdio.idle_warning``codex_stdio.idle_timeout``codex_stdio.provider_stream_disconnected``codex_stdio.missing_terminal_after_tool`。Codex notification 中 `item/started``status=inProgress``running` 或等价状态必须归一化为 `tool_call.started`,不得误报为 completed。
收口验证必须走 HWLAB Web dispatcher 等价原入口或同一 dispatcher 的 CLI,触发一条新 turn 并尽量包含一次只读工具调用;然后用 `bun scripts/cli.ts platform-infra observability trace --target <node> --trace-id <otelTraceId> --grep codex_stdio --full` 查询 Tempo。通过证据应显示 `services` 至少覆盖 `hwlab-cloud-api``agentrun-manager``agentrun-runner`codex span 中 `runId``commandId``runnerJobId` 不缺失,`valuesPrinted=false`,且错误 span 与业务终态一致。旧 trace 不会因后续 instrumentation 修复自动回填;旧 trace 缺少 codex runner span 时,只能写成“当时未采集到该事件”,不能倒推出 AgentRun 或 codex-stdio 当时没有运行。
收口验证必须走 HWLAB Web dispatcher 等价原入口或同一 dispatcher 的 CLI,触发一条新 turn 并尽量包含一次只读工具调用;然后用 `bun scripts/cli.ts platform-infra observability trace --target <node> --trace-id <otelTraceId> --grep codex_stdio --full` 查询 Tempo。通过证据应显示 `services` 至少覆盖 `hwlab-cloud-api``agentrun-manager``agentrun-runner`codex span 中 `runId``commandId``runnerJobId` 不缺失,`valuesPrinted=false`,且错误 span 与业务终态一致。若已知 trace 的 runner span 在默认摘要里看不到 `runnerJobId`,先用当前 UniDesk CLI 执行 `platform-infra observability trace --grep runnerJobId --full` 区分摘要器遗漏和 instrumentation 缺口;只有 raw/更新后的摘要仍缺字段,或同一 trace 没有 `agentrun-runner` service,才归为 AgentRun runner-side instrumentation 问题。旧 trace 不会因后续 instrumentation 修复自动回填;旧 trace 缺少 codex runner span 时,只能写成“当时未采集到该事件”,不能倒推出 AgentRun 或 codex-stdio 当时没有运行。
## AgentRun / HWLAB 失败归因标准