[codex] Preserve relay trace error causes#3377
Conversation
Co-authored-by: codex <codex@users.noreply.github.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
ApprovabilityVerdict: Approved This change enhances relay tracing by preserving nested error causes and cleaning up stack traces. The modifications are self-contained to the tracing module, include cycle detection to prevent issues, and only affect debugging output format—not application logic. You can customize Macroscope's approvability policy. Learn more. |
Summary
causechains when relay failures are handed to the OTLP tracerTesting
vp test packages/shared/src/relayTracing.test.tsvp checkvp run typecheckvpr typecheckNote
Low Risk
Changes are confined to best-effort telemetry sanitization in
nonInterferingTracer; application exit/failure behavior is unchanged.Overview
Relay client tracing now sanitizes failures for OTLP export without changing the failure values the app sees.
traceSafeErrorrecursively walkscausechains (with cycle protection), trims Effect-internal frames viacleanTraceStack, and folds nested causes into the exported exception stack as aCaused by:section.A new integration test builds the real tracing layer with a mocked HTTP client and asserts the ingest payload includes both the outer failure message and the root cause.
Reviewed by Cursor Bugbot for commit 56e6585. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Preserve error causes and clean stack traces in
traceSafeErrortraceSafeErrorin relayTracing.ts to propagate nested error causes, using aWeakSetto avoid cycles and appending aCaused by:section to the resulting stack.cleanTraceStackhelper that strips internal Effect/Generator frames from stack traces.Macroscope summarized 56e6585.