Repository navigation
fix(diagnostics): preserve OTEL startup failure during rollback - #119747
Conversation
|
@clawsweeper re-review Please review exact head This is the bounded follow-up regression repair for #119705 and #119694, rebased onto #119708. The fix preserves the primary NodeSDK startup failure when diagnostics-owned rollback cleanup also fails. Ordinary service-stop behavior, cleanup ordering, signal-specific protocol routing, gateway recovery, and configuration remain unchanged. Proof on this exact head:
|
|
🦞👀 Command router queued. I will update this comment with the next step. |
a0027e0 to
7c7f728
Compare
|
@clawsweeper re-review Please review exact head |
|
🦞👀 Command router queued. I will update this comment with the next step. |
7c7f728 to
6de8714
Compare
|
@clawsweeper re-review Exact head: Disposition of the prior exact-head rank-up move: applied. Diagnostics OTEL now logs the formatted rollback cleanup failure at its owner before preserving both startup and cleanup failures in the aggregate, and the plugin-service regression proves that detail remains host-visible without broadening generic service or gateway behavior. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Codex review: needs maintainer review before merge. Reviewed August 5, 2026, 6:37 PM ET / 22:37 UTC. ClawSweeper reviewWhat this changesThe PR retains the primary OpenTelemetry SDK startup error during rollback, logs any rollback cleanup failure at the diagnostics owner, and adds focused regression tests. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readinessKeep open. Current main still lets a rollback shutdown rejection replace the original OTEL SDK startup failure; this focused owner-boundary repair preserves both failures, with no blocking code finding found. Priority: P2 Review scores
Verification
How this fits togetherThe diagnostics OpenTelemetry plugin starts and cleans up telemetry SDK resources for the plugin-service host. Startup failures flow to the host logger, so rollback must not hide the error that stopped telemetry from starting. flowchart LR
A[Plugin service startup] --> B[Diagnostics OTEL plugin]
B --> C[OpenTelemetry SDK start]
C --> D{Startup succeeds?}
D -->|Yes| E[Active telemetry service]
D -->|No| F[Rollback cleanup]
F --> G[Preserved startup and cleanup errors]
G --> H[Plugin-service host logs]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +15, Tests +67. Total +82 across 3 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the diagnostics-local aggregate-and-log repair, then merge after exact-head CI and the latest ClawSweeper rank-up moves are confirmed. Do we have a high-confidence way to reproduce the issue? Yes—current main’s SDK-start catch awaits cleanup before rethrowing the captured error, and a rejecting cleanup path is explicitly rethrown by the lifecycle owner. Is this the best way to solve the issue? Yes—the diagnostics plugin owns both startup and rollback state; changing the generic plugin host would broaden behavior for unrelated services while losing the typed primary-error relationship. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 5ec4d9f82a6b. 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
|
|
ClawSweeper disposition for exact head
No code or head change was made after the exact-head review. |
|
Merged via squash.
|
…cope * origin/main: perf(agents): isolate concurrency benchmark workers (openclaw#119749) fix(diagnostics): preserve OTEL startup failure (openclaw#119747) fix(agents): seed fresh session identity before transcript append (openclaw#119473) fix: steering reaches active runs across agent harnesses (openclaw#119594) fix(cli): report accurate filtered node totals (openclaw#119744) fix(skills): keep installed verdicts scoped to publisher (openclaw#119672) fix(diagnostics): honor signal-specific OTLP protocols (openclaw#119708)
Fixes #119746
Related context:
What Problem This Solves
Fixes an issue where operators starting diagnostics OTEL could receive only a rollback cleanup failure when the OpenTelemetry SDK had already failed to start. The secondary shutdown error masked the failure that actually prevented telemetry startup.
Why This Change Was Made
The SDK startup owner now keeps the original startup error primary and preserves an owned rollback cleanup failure alongside it in an
AggregateError, with the startup error retained as the cause. The diagnostics owner also logs the formatted rollback cleanup failure before rethrowing, so the host-visible service error retains both actionable failures. Cleanup still drains through the existing lifecycle order.This follow-up does not change ordinary service-stop behavior, signal-specific protocol routing, gateway recovery, configuration, or exporter ownership. It preserves the protocol behavior landed in #119708.
Root cause: the SDK startup catch awaited the shared lifecycle cleanup before rethrowing the captured startup error. Because diagnostics-owned exporter cleanup may reject, that rejection could escape first and replace the already-captured startup failure. The initial aggregate preserved both errors structurally, but its static message left the nested cleanup detail invisible through the host logger, which records
error.message.Production LOC:
+16/-1.Test LOC:
+67/-0.User Impact
Operators now retain the primary reason telemetry startup failed and receive the rollback cleanup failure needed to diagnose incomplete exporter shutdown.
Evidence
173/173passed across two Vitest shards.oxfmt --check: clean on all three changed files.oxlint: clean on all three changed files.git diff --check: clean.0.93confidence.@opentelemetry/[email protected]types declarestart(): voidandshutdown(): Promise<void>; itsbuild/src/sdk.jsshutdown implementation returnsPromise.all(...), confirming that provider cleanup rejection is an upstream-supported outcome.6de8714e29e6a94806f28e81391b6eeb28f61366in https://github.com/openclaw/openclaw/actions/runs/31053078525.6de8714e29e6a94806f28e81391b6eeb28f61366in fix(diagnostics): preserve OTEL startup failure during rollback #119747 (comment).Local note: the full repo oxlint wrapper was blocked before target linting by an unrelated current-main plugin-SDK boundary diagnostic in
packages/terminal-core/src/ansi.ts:194(TS2554). The changed files pass isolated oxlint, and hosted CI remains the full-repo gate.