Skip to content

fix(sandbox): Gracefully handle unavailable sandbox sessions - #1664

Open
sentry[bot] wants to merge 2 commits into
mainfrom
seer/fix-sandbox-410-gone
Open

fix(sandbox): Gracefully handle unavailable sandbox sessions#1664
sentry[bot] wants to merge 2 commits into
mainfrom
seer/fix-sandbox-410-gone

Conversation

@sentry

@sentry sentry Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Previously, when tryRestoreHintedSandbox encountered an unavailable sandbox session (e.g., HTTP 410 Gone from Vercel's Sandbox API), it would re-throw the error. This prevented acquireSandbox from falling back to createFreshSandbox, leading to user-facing errors.

This change modifies tryRestoreHintedSandbox to clear the sandboxRef, invalidate the session, and return null when isSandboxUnavailableError is true. This allows acquireSandbox to correctly proceed with creating a fresh sandbox, improving resilience and user experience.

Additionally, an unrelated oxlint error in packages/junior/tests/component/task-execution/conversation-work.test.ts was fixed by replacing Reflect.get with typed property access to resolve a CI failure.

Fixes JUNIOR-7R

This PR was automatically generated by Sentry. You can adjust this setting at any time.

@vercel

vercel Bot commented Aug 22, 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 Aug 22, 2026 11:47pm

Request Review

@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 609aef6. Configure here.

throw error;
sandboxRef = undefined;
invalidateSession();
return null;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Prepare failure orphans restored sandbox

Medium Severity

After Sandbox.get succeeds, a prepare-time unavailable error now clears sandboxRef and returns null, so acquireSandbox builds a new sandbox. That drops the still-running named VM the old path kept for reconnect, and it never stopSessions the retrieved session, so the prior sandbox can keep burning resources until timeout.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 609aef6. Configure here.

@github-actions github-actions Bot added risk: medium PR risk score: medium and removed risk: high PR risk score: high labels Aug 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants