Skip to content

[codex] Preserve relay trace error causes#3377

Merged
juliusmarminge merged 1 commit into
mainfrom
codex/preserve-relay-trace-causes
Jun 20, 2026
Merged

[codex] Preserve relay trace error causes#3377
juliusmarminge merged 1 commit into
mainfrom
codex/preserve-relay-trace-causes

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Jun 20, 2026

Copy link
Copy Markdown
Member

Summary

  • preserve sanitized nested cause chains when relay failures are handed to the OTLP tracer
  • retain each cause stack in the exported exception stack without changing the public failure value
  • add an OTLP integration test covering the outer failure and root cause

Testing

  • vp test packages/shared/src/relayTracing.test.ts
  • vp check
  • vp run typecheck
  • vpr typecheck

Note

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. traceSafeError recursively walks cause chains (with cycle protection), trims Effect-internal frames via cleanTraceStack, and folds nested causes into the exported exception stack as a Caused 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 traceSafeError

  • Expands traceSafeError in relayTracing.ts to propagate nested error causes, using a WeakSet to avoid cycles and appending a Caused by: section to the resulting stack.
  • Adds cleanTraceStack helper that strips internal Effect/Generator frames from stack traces.
  • Adds tests verifying that exported trace payloads include both the error message and its nested cause.

Macroscope summarized 56e6585.

Co-authored-by: codex <codex@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Jun 20, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: d0b87c7d-eab5-40e9-a9d8-394e97eb00c0

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/preserve-relay-trace-causes

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Jun 20, 2026
@macroscopeapp

macroscopeapp Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: 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.

@juliusmarminge juliusmarminge merged commit ac77fe4 into main Jun 20, 2026
16 checks passed
@juliusmarminge juliusmarminge deleted the codex/preserve-relay-trace-causes branch June 20, 2026 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant