docs: record AgentRun codex stdio otel closeout

This commit is contained in:
Codex
2026-06-20 08:54:53 +00:00
parent a5104aca5b
commit 492edaf476
2 changed files with 29 additions and 0 deletions
+19
View File
@@ -98,6 +98,25 @@ OTel trace 内常见业务关联属性:
旧 trace 不会因为后续 instrumentation 修复自动回填。若旧 trace 查不到错误 span,但新的 canary/真实 trace 能查到同类 `runner_error.*` span,应把旧 trace 结论写成“当时未采集到该事件”,不要倒推出运行面没有发生过错误。
### AgentRun codex-stdio 追穿检查
追 HWLAB Workbench turn idle、`waitingFor=code-agent`、工具调用后无 terminal、`provider-stream-disconnected`,或用户怀疑 AgentRun/codex-stdio 仍在运行但 OTel 没追到时,必须在同一 OTel trace 里同时看到 `hwlab-cloud-api``agentrun-manager``agentrun-runner`。只看到 manager dispatch 或 HWLAB business trace 不算追穿 runner。
优先用业务入口拿到 OTel trace id,再按 codex span 过滤:
```bash
bun scripts/cli.ts platform-infra observability trace \
--target D601 \
--trace-id <otelTraceId> \
--grep codex_stdio \
--limit 120 \
--full
```
通过证据应能看到 `codex_app_server.starting``codex_app_server.started`、需要进程退出时的 `codex_app_server.exit``codex_stdio.thread_start.*``thread_resume.*``codex_stdio.turn_start.*``codex_stdio.tool_call.started|completed|failed``codex_stdio.turn_completed`,以及问题相关的 `idle_warning``idle_timeout``provider_stream_disconnected``missing_terminal_after_tool`。这些 span 应带 `runId``commandId``runnerJobId``runnerId``sessionId``backendProfile``sourceCommit``traceId``otel.trace_id``valuesPrinted=false`;缺少 `runnerJobId` 或没有 `agentrun-runner` service 时,先回 AgentRun runner-side instrumentation 排查。
如果需要确认工具调用 started/completed 的归一化,canary 应要求一次只读 shell 工具调用。Codex notification 的 `item/started` + `status=inProgress` 应落为 `codex_stdio.tool_call.started`,不得和 completed 混在一起。长期规则见 `docs/reference/agentrun.md#agentrun--hwlab-otel-追踪口径`
## Trace 读取窗口与乱序调查
排查 HWLAB/Workbench trace 乱序、分页缺口、`--after-seq`/`--tail` 不生效、旧 trace 只返回局部事件或 read model 是否完整时,优先查 `trace_events_read` span