Restart inherited sandbox sessions when metadata changes#43
Merged
t-kalinowski merged 1 commit intomainfrom Apr 22, 2026
Merged
Restart inherited sandbox sessions when metadata changes#43t-kalinowski merged 1 commit intomainfrom
t-kalinowski merged 1 commit intomainfrom
Conversation
25f35f9 to
2acdf61
Compare
f6b35c0 to
302322f
Compare
32f077c to
33eaaac
Compare
302322f to
1602999
Compare
Treat inherited sandbox metadata changes as worker-session boundaries, while keeping empty polls, bare interrupts, and pager-local commands local until a real worker interaction needs current metadata. Document the restart contract and add regression coverage for timeout bundles, session-ended pager commands, missing metadata recovery, explicit restarts, and guardrail recovery.
182a9f0 to
44f3f30
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.
Summary
Why
After the per-call metadata migration, inherited sandbox state still needed one clearer runtime rule: sandbox changes should take effect at the next real worker interaction. That avoids preserving an old worker session when the current tool-call metadata describes a different inherited sandbox.
Public-facing changes
Ctrl-Cremains local recovery behavior even if inherited sandbox metadata changedCtrl-C<code>andCtrl-D<code>run in the restarted session when the sandbox changedInternal-only changes
Diff composition
Measured against
origin/main, this PR is2,737insertions and603deletions across11files. Most of that is regression coverage and inline unit tests around worker/session transitions:src/:+725/-299(30.7%of churn)src/:+450/-53(15.1%of churn)tests/:+1,460/-237(50.8%of churn)+100/-12(3.4%of churn)+2/-2(0.1%of churn)The largest contributors are
tests/sandbox_state_updates.rs,src/worker_process.rs, and the inline tests insrc/worker_process.rs.