Repository navigation
feat: add opt-in telemetry for Windows node tool calls - #1015
Conversation
Add privacy-preserving gateway and MCP telemetry with typed outcomes, system.run phase diagnostics, bounded failure logs, and delivery-aware completion. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 8274c0b2-0aa9-4726-bc8c-b991f5b8e125
Nest authorization and run phases under tool execution, replace the redundant sandbox span with explicit containment attributes, and report finite host-side sandbox denial reasons. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 8274c0b2-0aa9-4726-bc8c-b991f5b8e125
|
Codex review: needs real behavior proof before merge. Reviewed July 20, 2026, 1:28 PM ET / 17:28 UTC. Summary Reproducibility: not applicable. This PR proposes a new diagnostics capability rather than reporting a failing current behavior. The claimed runtime behavior can be verified with a configured collector, gateway invocation, and local MCP invocation, but no inspectable current-head artifact has been supplied. Review metrics: 2 noteworthy metrics.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Maintainer decision needed
Security Review detailsBest possible solution: Keep the exported fields narrowly allowlisted, obtain maintainer approval for the gateway-and-MCP telemetry privacy contract, and attach redacted current-head collector or terminal proof covering both successful and denied Do we have a high-confidence way to reproduce the issue? Not applicable: this PR proposes a new diagnostics capability rather than reporting a failing current behavior. The claimed runtime behavior can be verified with a configured collector, gateway invocation, and local MCP invocation, but no inspectable current-head artifact has been supplied. Is this the best way to solve the issue? Unclear: the finite, typed telemetry design is a maintainable direction, but its exported gateway-and-MCP privacy contract requires maintainer approval and real current-head collector evidence before it is the best accepted solution. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against bd6c4bf8e575. Label changesLabel justifications:
Evidence reviewedWhat I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (1 earlier review cycle)
|
Co-authored-by: Copilot App <[email protected]> Copilot-Session: 8274c0b2-0aa9-4726-bc8c-b991f5b8e125
Co-authored-by: Copilot App <[email protected]> Copilot-Session: 8274c0b2-0aa9-4726-bc8c-b991f5b8e125
Preserve the V2 direct-argv approval path while extending the existing authorize and run telemetry to approved executions and compatibility denials. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 8274c0b2-0aa9-4726-bc8c-b991f5b8e125
Add a finite legacy or v2 approval-pipeline attribute to system.run traces and failure logs while keeping metrics unchanged. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 8274c0b2-0aa9-4726-bc8c-b991f5b8e125
Co-authored-by: Copilot App <[email protected]> Copilot-Session: 8274c0b2-0aa9-4726-bc8c-b991f5b8e125
Co-authored-by: Copilot App <[email protected]> Copilot-Session: 8274c0b2-0aa9-4726-bc8c-b991f5b8e125
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Co-authored-by: Copilot App <[email protected]> Copilot-Session: 602f2cbd-ce10-434a-9485-851e676869aa
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Final reviewed head: The maintainer review accepts the documented node-tool telemetry contract: export remains opt-in through a user-configured OTLP endpoint; exported fields are limited to canonical bounded tool names, transport, finite outcome/error/phase/sandbox values, durations/counts, and exception type names. Prompts, chat content, command argv/input/output, cwd/paths, file content, credentials/tokens, error messages, and arbitrary logs are excluded. Current-head proof covers OTLP/HTTP protobuf and OTLP/gRPC traces, metrics, and bounded failure logs; local MCP success, denial, and cancellation; cancellation uses neutral Independent exact-head reviews found no blocking privacy, security, cardinality, concurrency, exporter-generation, or protocol behavior defect (93% and 97% confidence). |
Additional instructions
MUST: Keep Allow edits from maintainers enabled for this PR so maintainers can help update the branch when needed.
What Problem This Solves
Operators can see that a Windows node tool failed, but existing telemetry does not explain whether it was rejected by exec policy, blocked before sandbox execution, failed inside the command, timed out, was canceled, or could not deliver its response. Gateway and local MCP invocations also lack a shared end-to-end diagnostic view.
Why This Change Was Made
Adds provider-neutral, privacy-reviewed instrumentation for gateway and MCP node tool calls without changing either protocol. Typed diagnostics preserve command execution semantics while reporting stable outcomes, failure categories, authorization/run phases, sandbox application and fallback details, and response-delivery failures.
User Impact
Operators can diagnose why an agent tool failed from traces, metrics, and bounded failure-only logs.
system.runtelemetry distinguishes exec-policy denial, unsupported sandbox requests, MXC availability/fallback, command failure, timeout, cancellation, and transport failure without exporting command arguments, payloads, output, paths, credentials, IDs, URLs, or error messages.Change Type
Scope
winnodeValidation
Current tested head:
a61e0bc104a855463e041f4f5ad94050057d356dCurrent
origin/mainmerged normally:653327abe5ed72806e9323e22252d9ce5563e299./build.ps1a61e0bc1a61e0bc1./scripts/validate-mxc-e2e.ps1without-AllowSkipExact-head MXC blocker
A clean pre-run audit found zero
OpenClawE2E-*distros, OpenClaw processes, or relevant listeners. The single authorized exact-head retry used fresh fixture0ece580aand newly selected port57765. Pinned upstream OpenClaw2026.6.11 (e085fa1)installed successfully, but its own systemd gateway again reportedgateway already running under systemdandEADDRINUSEuntil fixture initialization timed out.Both required tests failed in
E2ESetupFixture.InitializeAsync, so neithersystem.run/MXC assertion ran. Post-run cleanup proof:Artifacts are under
TestResults/E2E/0ece580aandTestResults/MxcE2E/OpenClaw.E2ETests.Mxc.trx. Two prior parent-head attempts reproduced the same blocker with fixtures5cab2143/port54578ande10fdbfe/port64284. No further loop was attempted.Real behavior proof
Environment: Windows x64, .NET SDK 10.0.302, official
otelcol-contrib0.156.0. The tray ran with isolated data. Collector evidence and MCP output below were captured from exact heada61e0bc1.Verified canceled-span fix
Both OTLP/HTTP protobuf and OTLP/gRPC collector runs produced the same mapping:
system.runOksuccessnonemetric tagErrorfailureexec_policy_deniedUnsetcanceledotherCanceled collector excerpt:
This fixes the verified review finding: canceled operations are no longer marked successful, while
openclaw.outcome=canceledand error-category semantics are preserved.Exact-head OTLP/HTTP and OTLP/gRPC proof
For each protocol, the official collector received:
system.runauthorize/run children with explicit parentageopenclaw.node.tool.invocationsandopenclaw.node.tool.durationOpenClaw.Telemetry.NodeToollogs with static eventNodeToolInvocationFailedReal MCP cancellation returned HTTP 204 for
notifications/cancelledand an MCP tool error containingcancelled.Canceled failure log fields remained bounded and content-free:
Exported data-boundary matrix
unknown; transport; outcome; finite error category; approval pipeline; finite sandbox fields; exception type onlyduration_ms; static event/bodyExact-head collector output was scanned for both success proof strings and
Start-Process,calc,ping 127.0.0.1,stdout,stderr,cwd,request.id,session, andcredential. Every match count was zero.Review results
ActivityStatusCode.Unset.The prior screenshot gallery was removed because it predates the exporter-generation safeguards and approval-pipeline field.
Security Impact
Compatibility and Migration
Residual risk and landing confidence
Implementation/privacy confidence: 96%. The cancellation-status defect is fixed and proven through both OTLP protocols on exact head, and hosted CI is green. The remaining landing decision is explicit maintainer acceptance of the telemetry contract and whether the reproducible upstream gateway fixture blocker can be accepted alongside earlier-head MXC evidence. Exact-head gateway/MXC execution is blocked, not passed.
Review Conversations