fix(sandbox): Gracefully handle unavailable sandbox sessions - #1664
fix(sandbox): Gracefully handle unavailable sandbox sessions#1664sentry[bot] wants to merge 2 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ 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; |
There was a problem hiding this comment.
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.
Reviewed by Cursor Bugbot for commit 609aef6. Configure here.


Previously, when
tryRestoreHintedSandboxencountered an unavailable sandbox session (e.g., HTTP 410 Gone from Vercel's Sandbox API), it would re-throw the error. This preventedacquireSandboxfrom falling back tocreateFreshSandbox, leading to user-facing errors.This change modifies
tryRestoreHintedSandboxto clear thesandboxRef, invalidate the session, and returnnullwhenisSandboxUnavailableErroris true. This allowsacquireSandboxto correctly proceed with creating a fresh sandbox, improving resilience and user experience.Additionally, an unrelated
oxlinterror inpackages/junior/tests/component/task-execution/conversation-work.test.tswas fixed by replacingReflect.getwith 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.