fix(sandbox): Recover cleanly from unavailable sessions#1012
Open
dcramer wants to merge 3 commits into
Open
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
dcramer
marked this pull request as ready for review
July 23, 2026 04:47
dcramer
force-pushed
the
codex/graceful-sandbox-recovery
branch
from
July 23, 2026 04:53
25e706e to
ee8e9ba
Compare
dcramer
force-pushed
the
codex/graceful-sandbox-recovery
branch
from
July 23, 2026 05:28
b44ea96 to
f264ba0
Compare
dcramer
force-pushed
the
codex/graceful-sandbox-recovery
branch
from
July 23, 2026 05:41
f264ba0 to
d32b3d5
Compare
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.
dcramer
force-pushed
the
codex/graceful-sandbox-recovery
branch
from
July 23, 2026 15:20
d32b3d5 to
bc6ae50
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.