Repository navigation
Conversation
This was referenced Oct 31, 2026
pthombre
force-pushed
the
pranav/envckpt-8-hold-pause
branch
2 times, most recently
from
November 2, 2026 06:16
bdd2ef3 to
d37376c
Compare
pthombre
force-pushed
the
pranav/envckpt-8-hold-pause
branch
from
November 3, 2026 03:22
d37376c to
4aee956
Compare
pthombre
force-pushed
the
pranav/envckpt-8-hold-pause
branch
from
November 3, 2026 06:40
4aee956 to
122b586
Compare
pthombre
force-pushed
the
pranav/envckpt-8-hold-pause
branch
from
November 5, 2026 20:07
122b586 to
42dabe5
Compare
Contributor
Author
pthombre
force-pushed
the
pranav/envckpt-8-hold-pause
branch
2 times, most recently
from
November 12, 2026 20:35
33acd80 to
8ddbaa7
Compare
…s its processes A VM memory snapshot (AgentENV) captures the whole sandbox at one instant, processes included, so a checkpoint does not need the harness frozen to get a consistent copy; freezing it there only adds the pause failures a process in uninterruptible sleep causes. The supervisor gains `--pause-mode hold`: a pause is acknowledged at once without signalling anything, the deadline stops counting until the continue as before, and the checkpoint holds the harness's model calls instead. The default stays `stop` (SIGSTOP/SIGCONT), which a files-only snapshot still needs. Each acknowledgement now names the pause mode and the supervisor's identity (`PID.START`, the marker it gives the processes it launches). `SandboxSession(pause_mode=...)` launches in that mode, and `checkpoint_state()` records the pause the supervisor holds and its identity, so a restore of a process-keeping snapshot can find the launch again. The sandbox checkpointer records whether the provider's snapshots keep processes (`keeps_processes`, false for older records), and the docs say what a restore keeps is provider-dependent. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Pranav Thombre <pthombre@nvidia.com>
…les, and record the pause a new supervisor holds Found in a review of the hold pause. - A server that declares `restore_policy = "before_agent_close"` no longer sends it on a provider whose snapshots keep the sandbox's processes: a fork of such a snapshot has the processes its grader needs, so the episode continues at every step. Until now only the documentation said so. - `SandboxSession.checkpoint_state()` reports a held pause only while the launch runs. A launch that was stopped while paused kept reporting it, and a restore would have looked for a supervisor that is gone. - A pause that reaches the sandbox after the launch command was sent, but before its supervisor started, is asked once more. The supervisor reads the request as it starts and holds the launch, and its acknowledgement names it; without the second request the checkpoint recorded a started launch and no supervisor holding it. - The supervisor's header says that it does not watch the harness during a hold: one that exits is reaped after the continue. Its usage text lists the pause options. - Docstrings and the two tutorial pages say what `confirmed` means in hold mode and that `reattach` takes the pause mode. - Tests: the hold-mode session test ends its harness itself and no longer leaves it behind when it fails; the supervisor's hold test checks the child and a detached service too and no longer races the deadline; a harness that ends during a hold, a stop during a hold, a hold before the launch, the branches of `checkpoint_state()`, `reattach` with a held pause, the pause mode in the launch command, and both provider kinds for the restore policy. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Pranav Thombre <pthombre@nvidia.com>
pthombre
force-pushed
the
pranav/envckpt-8-hold-pause
branch
from
November 16, 2026 21:44
8ddbaa7 to
7c2b211
Compare
This branch has not been deployed
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.
What changed and why
At a checkpoint, the process supervisor (#5268) freezes the harness with
SIGSTOPand continues it withSIGCONTafterwards. That is needed when the snapshot copies only files, as on OpenSandbox. But a process in uninterruptible sleep cannot be stopped, so the pause is then not confirmed and the harness is killed and relaunched.A VM memory snapshot (AgentENV, #5410) captures the whole sandbox at one instant, processes included, so the harness does not need to be frozen for a consistent copy. This PR adds a pause that holds the harness without signalling it, and records what a later restore needs to find the paused launch again.
Hold pause
stop.SandboxSession(pause_mode=...)launches the supervisor in that mode.What each acknowledgement records
Every pause and continue acknowledgement now carries:
mode:stoporhold.identity: the supervisor's PID and process start time.SandboxSession.checkpoint_state()records the held pause and the supervisor's identity. After a restore of a process-keeping snapshot, #5412 uses these to recognise the same launch.Checkpointer record
The sandbox checkpointer (#5265) records whether the provider's snapshots keep processes (
keeps_processes). Older records read asfalse.How it works
sequenceDiagram participant G as Gym (prepare and resume) participant S as Process supervisor participant H as Harness (OpenCode) G->>S: pause N alt stop mode (OpenSandbox) S->>H: SIGSTOP S-->>G: ack with seq N, mode stop, identity else hold mode (AgentENV) Note over H: keeps running, model calls held by the relay (PR 5412) S-->>G: ack with seq N, mode hold, identity end Note over G: snapshot the sandbox G->>S: continue N S->>H: SIGCONT (stop mode only)Where this sits in the stack
This stack checkpoints environment-server episodes whose agent harness runs in a sandbox the resources server lends. #5264 has merged, and the rest of the stack is rebased onto
mainafter it. #5265 to #5331 add checkpoints for OpenCode and the SWE servers on OpenSandbox. #5410 to #5413 add AgentENV (E2B API, VM memory snapshots), where a restored sandbox still runs the harness's processes, so OpenCode continues in place instead of being relaunched. Each PR's diff shows only that PR's change.Issue
No tracking issue exists. This is the checkpoint-side half of AgentENV in-place resume. #5412 and #5413 build on the pause mode and the recorded identity.
Validation
checkpoint_state(), unchanged stop mode, and thekeeps_processesrecord; existing suites pass; lint is clean.mainafter feat(checkpoint): protocol for harnesses that borrow a sandbox #5264 merged: the unit, server and process-level checkpoint suites fail only wheremainitself does, apart from intermittent failures in tests that pass when run alone or that fail the same way onmain.Compatibility
pause_modedefaults tostop, so OpenSandbox and every existing harness behave as before.keeps_processes, which reads asfalsewhen absent.🤖 Generated with Claude Code