Skip to content

fix(sandbox): Propagate trace context through egress#580

Merged
dcramer merged 10 commits into
mainfrom
fix/sandbox-egress-trace-propagation
Jun 10, 2026
Merged

fix(sandbox): Propagate trace context through egress#580
dcramer merged 10 commits into
mainfrom
fix/sandbox-egress-trace-propagation

Conversation

@dcramer

@dcramer dcramer commented Jun 9, 2026

Copy link
Copy Markdown
Member

Sandbox egress now carries Sentry trace propagation from the active bash command span into the Vercel Sandbox forwarding policy. The egress proxy continues that trace for its own proxy span, keeps the standard propagation headers when forwarding to Sentry upstreams, and strips them before forwarding to other providers.

This uses Sentry-standard sentry-trace, baggage, and traceparent headers rather than adding Junior-specific parentage headers. The sandbox network policy is refreshed inside the active bash span so shell-originated provider traffic can be correlated back to the tool execution that caused it.

Refs GH-557

@vercel

vercel Bot commented Jun 9, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
junior-docs Ready Ready Preview, Comment Jun 10, 2026 5:49pm

Request Review

Comment thread packages/junior/src/app.ts
Comment thread packages/junior/src/app.ts
@dcramer dcramer force-pushed the fix/sandbox-egress-trace-propagation branch from 31e7393 to 6f24153 Compare June 10, 2026 05:11
@dcramer dcramer marked this pull request as ready for review June 10, 2026 05:37
dcramer and others added 3 commits June 9, 2026 22:37
Forward Sentry trace propagation headers through sandbox egress so proxied
provider requests can continue from the active bash command span. Keep
propagation upstream for Sentry requests and strip it from other providers.

Refs GH-557
Co-Authored-By: GPT-5 Codex <codex@openai.com>
Allow Junior apps to opt sandbox egress domains into Sentry trace propagation,
including leading wildcard domains. Keep trace continuation behind verified
OIDC and signed egress context checks, and strip trace headers from
unconfigured upstreams.

Update unit and integration coverage plus the sandbox egress tracing specs
and generated API docs.

Co-Authored-By: GPT-5 Codex <codex@openai.com>
Remove the mutable sandbox trace-domain singleton and carry the configured
domains through app-scoped Slack runtime, queue, and proxy wiring.

Keep trace propagation headers stripped after credential transforms for
unconfigured domains, and cover verified trace continuation with proxy tests.

Co-Authored-By: GPT-5 Codex <codex@openai.com>
Apply app-owned sandbox trace config to idle resumed Slack continuations.

Each continuation slice still uses its own active trace data.

Co-Authored-By: GPT-5 Codex <codex@openai.com>
dcramer and others added 2 commits June 10, 2026 08:57
Include configured trace propagation domains in sandbox network policy.

Keep trace-only rules as header transforms without proxy forwarding.

Co-Authored-By: GPT-5 Codex <codex@openai.com>
Keep production conversation work construction on the configured factory path.

Co-Authored-By: GPT-5 Codex <codex@openai.com>
Trigger a fresh CodeQL run after GitHub failed during initialization.

Co-Authored-By: GPT-5 Codex <codex@openai.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 0462b52. Configure here.

Comment thread packages/junior/src/app.ts Outdated
Validate sandbox trace domains inside createApp rollback handling.

Failed app construction should not leave plugin globals mutated.

Co-Authored-By: GPT-5 Codex <codex@openai.com>
Apply current trace headers through the shared sandbox tool span.

All sandbox-backed tools now refresh egress policy before execution.

Rename the internal session helper to avoid shadowing the active-session refresh method.

Co-Authored-By: GPT-5 Codex <codex@openai.com>
Install trace propagation policies without credential egress and keep provider proxying gated on credential tokens.

Pass app-scoped trace config through OAuth resume generators and document continuation correlation.

Remove telemetry-coupled proxy unit assertions while preserving behavior-facing policy coverage.

Co-Authored-By: GPT-5 Codex <codex@openai.com>
@dcramer dcramer merged commit 5b692c1 into main Jun 10, 2026
16 checks passed
@dcramer dcramer deleted the fix/sandbox-egress-trace-propagation branch June 10, 2026 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant