Repository navigation
feat(diagnostics): trace completed harness commentary - #156343
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
@clawsweeper automerge |
|
🦞🧹
Draft PRs stay fix-only until GitHub marks them ready for review. Pause with Automerge progress:
Re-review progress:
|
|
Codex review: needs maintainer review before merge. Reviewed September 23, 2026, 8:32 AM ET / 12:32 UTC (Revision 4). ClawSweeper reviewWhat this changesAdds completed assistant commentary to diagnostic harness traces with optional bounded, redacted text, updates documentation and tests, and corrects a UI test fixture. Merge readiness✅ Ready for maintainer review The PR remains useful, and no actionable correctness or security defect was found. The previous pause was explicitly resolved; the subsequent handoff does not reopen that decision. Priority: P3 Review scores
Verification
How this fits togetherAgent harnesses emit progress events while running a turn. Diagnostics observes completed commentary and attaches metadata or explicitly enabled text to the existing OpenTelemetry harness span. flowchart LR
A[Harness progress events] --> B[Existing run ownership checks]
B --> C[Completed commentary filter]
C --> D[Duplicate suppression and content policy]
D --> E[Diagnostic event queue]
E --> F[Redaction and harness span]
D --> G[Metadata-only debug log]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +169, Tests +231, Docs +15. Total +415 across 16 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Keep commentary telemetry lifecycle-owned, best-effort, and governed by the existing opt-in content policy. Do we have a high-confidence way to reproduce the issue? Not applicable as a bug reproduction: this adds a diagnostic capability, and source inspection confirms the recorder is absent from fetched main. Is this the best way to solve the issue? Yes. Observing normalized completed events at the existing lifecycle owner avoids harness-specific duplication and preserves the established exporter privacy controls. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against a26bf69563b0. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles) |
|
@clawsweeper stop Pause only this diagnostics PR at Validation reached passing core and extension type checks, then the offline deadcode invocation lacked required tarballs and wrote to its dependency store. The checkout-identity guard rejected the resulting The maintainer will resolve the current merge conflict in the existing task checkout, obtain remote proof, and re-enroll this PR for exact-head review and gated squash merge. The existing |
|
🦞✅ I added |
d5f7d12 to
7a38f1c
Compare
|
@clawsweeper re-review Please review exact head No configuration was added: commentary text uses the existing |
|
🦞👀 Re-review progress:
|
514d329 to
aee0a1d
Compare
|
@clawsweeper re-review Please review exact head The inherited scroll fixture correction also passed all 123 ownership tests and its ui-chat test-type graph. Diagnostics still reuses This is a read-only exact-head review request. Source repair remains paused while fresh CI runs. |
|
🦞👀 Re-review progress:
|
|
@clawsweeper automerge Explicit maintainer decision: resume landing for exact reviewed head Both required |
|
@clawsweeper stop Pause the hosted automerge/source-repair controller for an ownership handoff to the canonical The explicit maintainer landing decision remains in force. This pause prevents competing hosted mutations while the canonical native wrapper performs the guarded exact-head squash; it does not request another review or source repair. |
|
🦞✅ I added |
|
Merged via squash.
|
* feat(diagnostics): trace completed harness commentary * fix(diagnostics): keep commentary event type internal * fix(diagnostics): account for commentary in stability projection * refactor(diagnostics): separate event fields and snapshot queries * test(ui): provide scroll pane identity in ownership fixture
Related: #156330
What Problem This Solves
Operators cannot correlate completed assistant commentary with the harness activity in a diagnostic trace.
User Impact
Supported harnesses emit
agent.commentarydiagnostics andopenclaw.agent.commentaryevents on their harness spans. Existing debug logging records completion metadata. The existingdiagnostics.otel.captureContentsetting controls trace text; no configuration fields, defaults, or storage formats are added.Content remains off by default. When enabled, visible commentary is capped at 16,384 characters before queueing and passes through the existing exporter redaction. Ordinary logs and public diagnostic events receive metadata only.
Why This Change Was Made
Subscribe at the harness attempt lifecycle after core event ownership checks. Capture the harness trace before asynchronous transport callbacks, suppress recent duplicate completions, and unsubscribe on every exit. Claude CLI registers after preparation publishes its effective config and execution owner.
Commentary shares the diagnostic FIFO with harness completion, so it reaches the existing span before that span ends. It remains best-effort telemetry; queue pressure and normal SDK event limits apply.
Evidence
aee0a1d970544b09a30be764b036744df2ce4716, rebased on9bb3ccca699058b17196d803f14c6da1f8ae5d29. Independent review confirmed the earlier CLI conflict adaptation preserves operator-model admission, revocation, cleanup, and diagnostic subscription ownership. All five commits are patch-identical across this second refresh, including the test-only fixture correction.7a38f1c11d76d476393723356363e49f823f9f0eand frozen dependency inputs were verified on Testbox. All 61 tests passed across five files: harness lifecycle, CLI diagnostics, CLI operator-model execution, diagnostic stability, and real OpenTelemetry SDK commentary events. The four Vitest shards completed in 86.54 seconds.414782450952a196bbb64b1605a458c2531c47b6: MessagePhase, AgentMessage, and phase-free deltas.test/tsconfig/tsconfig.core.test.ui-chat.jsonpassed on Node 24.19.0 with frozen dependencies. The fixture, controller, all direct test-helper inputs, and relevant configs are identical in both commentary PRs; fresh CI still qualifies each final head independently.server.sessions.permission-root,server.sessions.create, andserver.sessions.permissions-hookspassed in 214.09 seconds.yielded: trueandaborted: true. The unmodified reset → complete file passed both cases on the frozen new base (65.30 seconds) and final candidate (44.70 seconds), with the same runtime and dependencies. The earlier trigger remains unproven; no yield production change or test weakening is included here.Fresh exact-head CI and ClawSweeper review remain the merge gates.