feat(diagnostics): emit exec process telemetry#71451
Conversation
Greptile SummaryThis PR adds a bounded Confidence Score: 4/5Safe to merge; only a minor cosmetic issue with the UTF-16 length of commandLength was found. All findings are P2 or lower. The new event type is well-bounded, tests cover both the internal event shape and the OTEL export boundary, and the four emission sites are mutually exclusive. No data loss, no security exposure, and no runtime errors were identified. No files require special attention. Prompt To Fix All With AIThis is a comment left during a code review.
Path: src/agents/bash-tools.exec-runtime.ts
Line: 190
Comment:
**`commandLength` counts UTF-16 code units, not Unicode code points**
`params.command.length` reports the number of UTF-16 code units. Commands containing characters outside the Basic Multilingual Plane (e.g. emoji) will report a `commandLength` that is larger than the visible character count. For this diagnostic metric the difference is unlikely to matter in practice, but it is worth documenting — or switching to `[...params.command].length` / `Array.from(params.command).length` if accurate code-point counts are preferred.
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "feat(diagnostics): emit exec process tel..." | Re-trigger Greptile |
| mode: params.mode, | ||
| outcome: params.outcome.status, | ||
| durationMs: params.outcome.durationMs, | ||
| commandLength: params.command.length, |
There was a problem hiding this comment.
commandLength counts UTF-16 code units, not Unicode code points
params.command.length reports the number of UTF-16 code units. Commands containing characters outside the Basic Multilingual Plane (e.g. emoji) will report a commandLength that is larger than the visible character count. For this diagnostic metric the difference is unlikely to matter in practice, but it is worth documenting — or switching to [...params.command].length / Array.from(params.command).length if accurate code-point counts are preferred.
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/agents/bash-tools.exec-runtime.ts
Line: 190
Comment:
**`commandLength` counts UTF-16 code units, not Unicode code points**
`params.command.length` reports the number of UTF-16 code units. Commands containing characters outside the Basic Multilingual Plane (e.g. emoji) will report a `commandLength` that is larger than the visible character count. For this diagnostic metric the difference is unlikely to matter in practice, but it is worth documenting — or switching to `[...params.command].length` / `Array.from(params.command).length` if accurate code-point counts are preferred.
How can I resolve this? If you propose a fix, please make it concise.- Two Diagnostics/OTEL Changes entries credited issue #70424 (jlapenna's open meta-tracing proposal) as the PR ref. The actual implementing PRs landed as #71451 (exec-process telemetry) and #71450 (preloaded SDK mode), both authored by @vincentkoc — corrected. - Telegram/webhook fix had no Thanks credit. Issue #71392 reporter @joelforsberg46-source identified the delivery-retry behaviour, so credit them on the entry.
… tool-result pruning entries Three entries were missing co-credits I should have preserved: - Diagnostics/OTEL exec-process spans (#71451): @vincentkoc implemented, but @jlapenna's #70424 proposed the broader tracing work this entry builds on. Now credits both. - Diagnostics/OTEL preloaded SDK (#71450): same pattern — credits @vincentkoc and @jlapenna. - Agents/tool-result pruning (#51267): @cgdusek's PR explicitly built on prior work in #39331 by @alvinttang and #34980 by @coffeexcoin. Now credits all three.
- Two Diagnostics/OTEL Changes entries credited issue openclaw#70424 (jlapenna's open meta-tracing proposal) as the PR ref. The actual implementing PRs landed as openclaw#71451 (exec-process telemetry) and openclaw#71450 (preloaded SDK mode), both authored by @vincentkoc — corrected. - Telegram/webhook fix had no Thanks credit. Issue openclaw#71392 reporter @joelforsberg46-source identified the delivery-retry behaviour, so credit them on the entry.
… tool-result pruning entries Three entries were missing co-credits I should have preserved: - Diagnostics/OTEL exec-process spans (openclaw#71451): @vincentkoc implemented, but @jlapenna's openclaw#70424 proposed the broader tracing work this entry builds on. Now credits both. - Diagnostics/OTEL preloaded SDK (openclaw#71450): same pattern — credits @vincentkoc and @jlapenna. - Agents/tool-result pruning (openclaw#51267): @cgdusek's PR explicitly built on prior work in openclaw#39331 by @alvinttang and openclaw#34980 by @coffeexcoin. Now credits all three.
- Two Diagnostics/OTEL Changes entries credited issue openclaw#70424 (jlapenna's open meta-tracing proposal) as the PR ref. The actual implementing PRs landed as openclaw#71451 (exec-process telemetry) and openclaw#71450 (preloaded SDK mode), both authored by @vincentkoc — corrected. - Telegram/webhook fix had no Thanks credit. Issue openclaw#71392 reporter @joelforsberg46-source identified the delivery-retry behaviour, so credit them on the entry.
… tool-result pruning entries Three entries were missing co-credits I should have preserved: - Diagnostics/OTEL exec-process spans (openclaw#71451): @vincentkoc implemented, but @jlapenna's openclaw#70424 proposed the broader tracing work this entry builds on. Now credits both. - Diagnostics/OTEL preloaded SDK (openclaw#71450): same pattern — credits @vincentkoc and @jlapenna. - Agents/tool-result pruning (openclaw#51267): @cgdusek's PR explicitly built on prior work in openclaw#39331 by @alvinttang and openclaw#34980 by @coffeexcoin. Now credits all three.
- Two Diagnostics/OTEL Changes entries credited issue openclaw#70424 (jlapenna's open meta-tracing proposal) as the PR ref. The actual implementing PRs landed as openclaw#71451 (exec-process telemetry) and openclaw#71450 (preloaded SDK mode), both authored by @vincentkoc — corrected. - Telegram/webhook fix had no Thanks credit. Issue openclaw#71392 reporter @joelforsberg46-source identified the delivery-retry behaviour, so credit them on the entry.
… tool-result pruning entries Three entries were missing co-credits I should have preserved: - Diagnostics/OTEL exec-process spans (openclaw#71451): @vincentkoc implemented, but @jlapenna's openclaw#70424 proposed the broader tracing work this entry builds on. Now credits both. - Diagnostics/OTEL preloaded SDK (openclaw#71450): same pattern — credits @vincentkoc and @jlapenna. - Agents/tool-result pruning (openclaw#51267): @cgdusek's PR explicitly built on prior work in openclaw#39331 by @alvinttang and openclaw#34980 by @coffeexcoin. Now credits all three.
- Two Diagnostics/OTEL Changes entries credited issue openclaw#70424 (jlapenna's open meta-tracing proposal) as the PR ref. The actual implementing PRs landed as openclaw#71451 (exec-process telemetry) and openclaw#71450 (preloaded SDK mode), both authored by @vincentkoc — corrected. - Telegram/webhook fix had no Thanks credit. Issue openclaw#71392 reporter @joelforsberg46-source identified the delivery-retry behaviour, so credit them on the entry.
… tool-result pruning entries Three entries were missing co-credits I should have preserved: - Diagnostics/OTEL exec-process spans (openclaw#71451): @vincentkoc implemented, but @jlapenna's openclaw#70424 proposed the broader tracing work this entry builds on. Now credits both. - Diagnostics/OTEL preloaded SDK (openclaw#71450): same pattern — credits @vincentkoc and @jlapenna. - Agents/tool-result pruning (openclaw#51267): @cgdusek's PR explicitly built on prior work in openclaw#39331 by @alvinttang and openclaw#34980 by @coffeexcoin. Now credits all three.
- Two Diagnostics/OTEL Changes entries credited issue openclaw#70424 (jlapenna's open meta-tracing proposal) as the PR ref. The actual implementing PRs landed as openclaw#71451 (exec-process telemetry) and openclaw#71450 (preloaded SDK mode), both authored by @vincentkoc — corrected. - Telegram/webhook fix had no Thanks credit. Issue openclaw#71392 reporter @joelforsberg46-source identified the delivery-retry behaviour, so credit them on the entry.
… tool-result pruning entries Three entries were missing co-credits I should have preserved: - Diagnostics/OTEL exec-process spans (openclaw#71451): @vincentkoc implemented, but @jlapenna's openclaw#70424 proposed the broader tracing work this entry builds on. Now credits both. - Diagnostics/OTEL preloaded SDK (openclaw#71450): same pattern — credits @vincentkoc and @jlapenna. - Agents/tool-result pruning (openclaw#51267): @cgdusek's PR explicitly built on prior work in openclaw#39331 by @alvinttang and openclaw#34980 by @coffeexcoin. Now credits all three.
Summary
exec.process.completeddiagnostic event for host/sandbox exec process outcomesopenclaw.execspans andopenclaw.exec.duration_msmetricsThis is the safe replacement for the exec/docker tracing portion of #70424. It keeps core agent code free of direct OpenTelemetry imports and lets the diagnostics-otel plugin remain the OTEL boundary.
Validation
git diff --check HEAD~1..HEADpnpm test extensions/diagnostics-otel/src/service.test.ts src/agents/bash-tools.exec-runtime.pty-fallback.test.tswas queued behind another local heavy-check lock in/Users/vincentkoc/.codex/worktrees/openclaw-openclaw/fix-gateway-restart-drain-c117686and was cancelled rather than stacking local checkspnpm tsgo:core && pnpm tsgo:extensionshit the same local heavy-check lock and was cancelled; CI is expected to provide the post-rebase proof