Skip to content

fix(sandbox): Recover cleanly from unavailable sessions#1012

Open
dcramer wants to merge 3 commits into
mainfrom
codex/graceful-sandbox-recovery
Open

fix(sandbox): Recover cleanly from unavailable sessions#1012
dcramer wants to merge 3 commits into
mainfrom
codex/graceful-sandbox-recovery

Conversation

@dcramer

@dcramer dcramer commented Jul 23, 2026

Copy link
Copy Markdown
Member

Sandbox operations now fail the current call with a safe tool error when the
acquired Vercel session becomes unavailable, retain the persistent sandbox ID,
and lazily reacquire on the next call. No operation is replayed, so commands
and writes with uncertain side effects remain safe.

This supersedes #966's per-tool retry approach by pinning SDK work to the exact
acquired session and centralizing lifecycle invalidation. Session-scoped errors
also cannot invalidate a newer session during parallel work. Regression
coverage includes setup and restore failures, file and command interruptions,
lazy cache rebinding, and late concurrent failures.

@vercel

vercel Bot commented Jul 23, 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 Jul 23, 2026 3:21pm

Request Review

dcramer added 3 commits July 23, 2026 08:18
Fail the current operation as a safe tool error without replaying it, then lazily reacquire the disposable sandbox on a later operation. Pin SDK work to the acquired session and scope invalidation to its session identity.

Refs #966
Expose FileSystem and session-level operations in Vercel Sandbox mocks so unit coverage exercises the pinned-session adapter.
Let each pinned session invalidate manager state directly when Vercel reports a lifecycle failure. Keep tool boundaries responsible only for safe error translation, and use session terminology outside the egress layer.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: high PR risk score: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant