Repository navigation
fix(diagnostics): keep internal thinking out of telemetry [AI] - #115261
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 28, 2026, 12:17 PM ET / 16:17 UTC. ClawSweeper reviewWhat this changesThe PR changes the diagnostics OpenTelemetry plugin so opt-in content capture omits provider-internal thinking, reasoning fields, and replay signatures while preserving visible text and tool-call metadata. Merge readiness⛔ Blocked until real behavior proof from a real setup is added - 4 items remain Keep this PR open for maintainer review and real behavior proof. The branch makes a focused privacy-boundary change, but the supplied evidence is limited to mocked unit coverage and static checks; it does not show a redacted live OTLP export after the fix. Priority: P2 Review scores
Verification
How this fits togetherThe diagnostics OpenTelemetry plugin listens to model-call events from the Gateway and serializes selected content into OTLP span attributes and GenAI message attributes. This change sits at the serialization boundary before content leaves OpenClaw for an operator-controlled telemetry backend. flowchart LR
A[Gateway model-call events] --> B[Diagnostics OpenTelemetry plugin]
B --> C[Content-capture policy]
C --> D[Reasoning redaction]
D --> E[OTLP compatibility attributes]
D --> F[GenAI message attributes]
E --> G[Telemetry collector]
F --> G
Decision needed
Why: The branch changes externally consumed telemetry data and protects a sensitive serialization boundary; mocked assertions establish intent but do not establish the actual exporter output that operators receive. Before merge
Agent review detailsSecurityNone. PR surfaceSource +73, Tests +116, Docs +2. Total +191 across 4 files. View PR surface stats
Review metricsNone. Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Add a redacted live OTLP collector payload or stdout JSONL transcript that includes representative thinking, redacted-thinking, replay-field, and signature canaries, proves none leave OpenClaw, and proves visible text plus tool-call metadata still export. Do we have a high-confidence way to reproduce the issue? No high-confidence end-to-end reproduction is included. The branch’s focused source-level tests construct internal-reasoning canaries and verify serialized attributes, but no current-head collector or stdout export demonstrates the full runtime path. Is this the best way to solve the issue? Unclear. Redacting at the centralized content-serialization boundary is a plausible narrow solution, but a real export artifact is needed to establish that the chosen boundary covers the operator-visible telemetry representations without suppressing approved visible content. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 8d5a652ed838. LabelsLabel changes:
Label 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 (1 earlier review cycle)
|
|
ClawSweeper proof for current head 6773de3 Behavior proved: provider-private reasoning and replay values are redacted from captured model-message telemetry while approved visible text and tool-call content still reaches the exporter. Environment: trusted local PR checkout on Linux, Docker OpenTelemetry Collector Command/artifact:
Evidence:
Compatibility/operator note: content capture still exports visible text and stable tool-call content; only provider-private reasoning and replay state is removed or represented by a redacted structural marker. Live gaps: no hosted telemetry backend was used. The proof used the real local Collector image and the production OpenClaw network exporter, so external backend storage/query behavior was not exercised. |
ClawSweeper reviewReviewed July 28, 2026, 5:08 PM UTC. What this changesThe diagnostics OpenTelemetry plugin redacts provider-private reasoning and replay metadata from captured model messages while retaining visible text and tool-call content, with matching documentation and regression coverage. PR surface: Source +73, Tests +116, Docs +2. Total +191 across 4 files. Merge readinessResult: needs maintainer review before merge. Overall: 🐚 platinum hermit Reviewed head: Review scores
VerificationStatus: sufficient How this fits togetherTrusted model-call diagnostics carry optional private prompt and response data into the diagnostics plugin. When content capture is enabled, the plugin converts those messages into compatibility and OpenTelemetry GenAI attributes before exporting them to the configured telemetry sink. flowchart LR
A[Model call messages] --> B[Trusted diagnostics event]
C[Content capture setting] --> D{Capture enabled?}
B --> D
D -->|No| E[Telemetry without content]
D -->|Yes| F[Redact private reasoning]
F --> G[Message attributes]
G --> H[OTLP collector or backend]
Decision needed
Before merge
Review detailsBest possible solution: Define provider-private reasoning and replay metadata as non-exportable under Do we have a high-confidence way to reproduce the issue? Yes—current-main and v2026.7.1 source deterministically serialize thinking content and raw replay metadata when content capture is enabled. The review did not execute a fresh vulnerable-main run, so the structured status is source-reproducible rather than reproduced. Is this the best way to solve the issue? Yes—the common diagnostics exporter is the narrowest maintainable enforcement point because it covers embedded, CLI, and plugin-runtime producers without duplicating provider-specific filtering. Producer-side filtering would leave the compatibility serializer as a second potential source of leakage. AGENTS.md: found_applied Codex review notes: model internal, reasoning high; reviewed against ca48f6c. Label detailsLabel justifications:
Evidence reviewedPR surface:
|
Verification before mergeVerified head:
Focused validation:
Behavior proof:
Best-fix assessment: filtering once at the diagnostics exporter is the correct owner boundary because it covers completed/error and input/output projections without mutating private diagnostic data for unrelated consumers. Residual risk: telemetry consumers that intentionally queried provider-private reasoning or replay values will now see omission or a redacted structural marker. No hosted telemetry backend was used; the proof exercised the production network exporter and a real local Collector. |
* origin/main: fix(zalo): stop provider startup after gateway shutdown (#115763) fix(agents): bound completed background process retention (#115760) fix(plugins): bound hook execution and retire stale registrations (#115695) fix(ui): collapse custodian startup error gap (#115720) fix(gateway): reload edited hook transforms (#107875) refactor: centralize channel streaming config hints (#115739) fix(msteams): finalize sent replies after dispatch (#82354) fix(cron): deliver explicitly configured failure alerts (#115762) fix(hooks): resolve inbound claim conversation once (#115491) refactor: retire legacy provider and secret paths (#115655) fix(memory): reject malformed QMD result entries (#115705) fix(diagnostics): keep internal thinking out of telemetry [AI] (#115261) fix(ui): localize remaining control surfaces (#115730) fix(gateway): prevent model owner mismatch after plugin activation (#115747) fix(agents): run reply hooks for restart recovery (#115711) fix(cron): initialize detached hook run sessions (#115765) fix(ios): keep stop available for staged voice notes (#115744) fix(doctor): preserve config includes during cleanup (#115723) fix(memory): keep dreaming consolidation within project scope (#115721) fix(discord): keep tool rows under verbose progress (#111947) # Conflicts: # ui/src/pages/custodian/custodian-surface.ts # ui/src/styles/custodian.css
…law#115261) * fix(diagnostics): exclude internal thinking from telemetry * fix(diagnostics): redact replay reasoning fields * fix(diagnostics): omit replay signatures from telemetry * chore: sync removed test helper
What Problem This Solves
Fixes an issue where operators using opt-in OpenTelemetry content capture could export provider-internal thinking payloads alongside visible model output.
Why This Change Was Made
The diagnostics plugin now replaces internal thinking blocks with a redacted structural marker in OpenClaw compatibility attributes and omits those blocks from standardized GenAI message parts. Visible text and tool-call identity continue to be captured, and the operator documentation now states the boundary explicitly.
User Impact
Operators can continue capturing approved prompt, response, tool, and tool-definition content without sending provider-internal thinking payloads to their telemetry backend. Content capture remains opt-in, and there are no config or migration changes.
Evidence
node scripts/run-vitest.mjs extensions/diagnostics-otel/src/service.test.ts— 110 tests passed../node_modules/.bin/oxfmt --check extensions/diagnostics-otel/src/service-genai-content.ts extensions/diagnostics-otel/src/service.test.ts docs/gateway/opentelemetry.md docs/gateway/configuration-reference.md— passed.git diff --check— passed.AI-assisted: yes.