Repository navigation
feat(diagnostics): chain gateway traces into runs - #92161
lanzhi-lee wants to merge 1 commit into
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed August 1, 2026, 11:17 AM ET / 15:17 UTC. ClawSweeper reviewWhat this changesThis PR carries trusted Gateway request trace context into embedded agent runs and adds OpenTelemetry invocation spans so Gateway, harness, run, model, and tool work can share one trace. Merge readiness⛔ Blocked until real behavior proof from a real setup is added - 6 items remain Keep open: the requested Gateway-to-run trace chain is not on current Priority: P2 Review scores
Verification
How this fits togetherGateway HTTP and WebSocket requests establish diagnostic trace context for inbound work. Embedded agent runs and the diagnostics OpenTelemetry plugin consume that context to emit and export a connected lifecycle trace. flowchart LR
A[Inbound Gateway request] --> B[Gateway trace context]
B --> C[WebSocket or HTTP dispatch]
C --> D[Embedded agent run]
D --> E[Invocation lifecycle events]
E --> F[OpenTelemetry diagnostics plugin]
F --> G[Linked exported trace]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +197, Tests +211. Total +408 across 11 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Rebase onto current main, make invocation completion use the same final terminal-outcome classification as the embedded-run lifecycle owner, add a regression for the post-compaction abort path, and attach redacted runtime trace-export evidence. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: make Is this the best way to solve the issue? No. The trace-chain design remains useful, but its completion event must be emitted after the embedded-run lifecycle has determined the canonical terminal outcome, not from the earlier promise rejection handler. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 71a59512ba47. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles)
|
|
This pull request has been automatically marked as stale due to inactivity. |
|
Closing this draft because its useful trace-chain work has been superseded by the current owner architecture, while its remaining The modern path is now split cleanly:
The one distinct remaining capability, trusted inbound HTTP continuation, is already isolated in #112991. Porting this older draft would reintroduce a second invocation lifecycle around the canonical run owner and preserve the known abort/error contradiction. Thanks for establishing the original direction and tests; that work materially informed the landed implementation. |
Summary
DiagnosticTraceContextinstead of adding a second run/request scope.run.invocation/run.invocation.completeddiagnostic events.Verification
node scripts/run-vitest.mjs src/gateway/request-diagnostic-trace.test.ts src/gateway/server-http.request-trace.test.ts src/agents/embedded-agent-runner/run.diagnostic-trace-chain.test.tsgit diff --checknode scripts/run-tsgo.mjs -p tsconfig.extensions.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/extensions.tsbuildinfo(blocked after rebase by existing upstreamsrc/agents/sessions/sdk.ts:279TS2322, not touched by this branch)node scripts/run-tsgo.mjs -p tsconfig.core.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/core.tsbuildinfo(blocked after rebase by existing upstreamsrc/agents/sessions/sdk.ts:279TS2322, not touched by this branch).agents/skills/autoreview/scripts/autoreview --mode local(clean before final rebase; reruns after rebase drove the fixes in this branch, latest focused tests remain green; current core/extension tsgo is blocked by the upstream type drift above)Notes
The gateway helper intentionally ignores inbound
traceparentby default and only honors it for local-direct gateway boundaries, so public unauthenticated requests cannot spoof trusted telemetry trace IDs.