You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(server): keep old runtime status from failing sandbox restarts - #5237
During a sandbox restart, a periodic status check can still see the previous run's exited container or no container at all. That stale observation can mark the new start as failed. Protect the start until its driver operation settles, then retain the replacement's actual readiness or failure.
Continues @prekshivyas's published candidate in #4932 and shares reconciliation guards and lifecycle coverage with @TaylorMutch's #4983. This also handles atomic start ownership and legacy retries. Resolve the shared scope and landing order before merging; after #4983 lands, reduce this PR to the remaining changes.
Changes
Save the new start and its driver ownership together; retries retain the same generation and session.
Defer stale observations while preserving readiness checks and genuine later failures.
Settle ownership on preparation failure and keep deletion cleanup and unrelated sandboxes responsive.
Release Notes
Sandbox restarts no longer fail because a periodic check applies the previous run's state during the new start.
Testing
Independent review of the rebase adaptations
Rust formatting and diff checks
Unit tests added/updated (if applicable)
Rust regressions and E2E on the rebased head: pending hosted CI
Local Rust validation was interrupted by disk exhaustion and removal of the shared build cache.
shiju-nv
changed the title
fix(server): prevent stale observations from failing sandbox restarts
fix(server): keep old runtime status from failing sandbox restarts
Nov 4, 2026
Label test:e2e applied, but pull-request/5237 is at fe8eaf2 while the PR head is 7a6b276. A maintainer needs to comment /ok to test 7a6b276729a83403776bb80b5e48b2765f7e4c32 to refresh the mirror. Once the mirror catches up, re-run Branch E2E Checks from the Actions tab.
It looks like it's because the #5204 was merged, which deletes the branch.
Usually what happens in this case is these stacked PRs would be updated to main, but because this PR is opened from the external fork (shiju-nv/OpenShell) that didn't happen and instead this got closed. I cannot reopen it, I think you'll need to update the base branch and open it? Please let me know if you need help.
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
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.
Summary
During a sandbox restart, a periodic status check can still see the previous run's exited container or no container at all. That stale observation can mark the new start as failed. Protect the start until its driver operation settles, then retain the replacement's actual readiness or failure.
Related Issue
Closes #4932. Related: #4981 and #5114. Rebased onto
mainafter #5204 merged.Continues @prekshivyas's published candidate in #4932 and shares reconciliation guards and lifecycle coverage with @TaylorMutch's #4983. This also handles atomic start ownership and legacy retries. Resolve the shared scope and landing order before merging; after #4983 lands, reduce this PR to the remaining changes.
Changes
Release Notes
Sandbox restarts no longer fail because a periodic check applies the previous run's state during the new start.
Testing
Local Rust validation was interrupted by disk exhaustion and removal of the shared build cache.
Checklist