Repository navigation
Conversation
dfadd70 to
150cbdb
Compare
150cbdb to
3329a26
Compare
|
Rebased onto the current stack base and appended one commit (3329a26): |
3329a26 to
a66405e
Compare
a66405e to
9cbd3b8
Compare
9cbd3b8 to
2c0013f
Compare
|
Rewritten in place (2026-10-09): an explicit snapshot taken at commit is now the only restore point of a checkpointed sandbox. Pause is no longer a restore point: the lazy thaw, resume hooks, 🤖 Generated with Claude Code |
2c0013f to
8030978
Compare
8030978 to
3741380
Compare
3741380 to
468341d
Compare
468341d to
d2da397
Compare
d2da397 to
9df42ec
Compare
9df42ec to
634fa5b
Compare
63f4dca to
5d2487d
Compare
5d2487d to
cbdd2c6
Compare
…ckpoint opens An agent harness such as OpenCode runs a whole rollout as one wait step, which a checkpoint would wait for past any deadline while the policy model server holds the harness's next call until resume. A checkpoint now raises a park request when it closes admission and withdraws it when admission reopens, read through `LegacyRun.park_requested` and awaited with `LegacyRun.wait_park_requested()`. On the request the run stops the harness at a safe point and records a boundary that continues it, which parks the run until resume; the run continues from it after the resume, or the replacement attempt after a crash, in the sandbox the owner names through `/sandbox_access`. A restart is never asked to park. Process-level evidence: an OpenCode-shaped harness agent over the sandboxed notes server is interrupted by a checkpoint and continued after the resume and after a crash, with a negative control that relaunches the harness in the sandbox its boundary names instead of asking the owner. Signed-off-by: Pranav Prashant Thombre <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
…kpoint A harness waits for the park request from its launch, so a close must wake a waiter already blocked on it. The earlier tests closed admission before their waiter first ran, so they only covered a request already raised: dropping the set() in EpisodeSteps.close() left every test passing. Add that case, a close and reopen that the waiter must not mistake for a request, and a run interrupted by two checkpoints in turn. Signed-off-by: Pranav Prashant Thombre <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
cbdd2c6 to
5a2daaa
Compare
Every protocol change the environment-server checkpointing of sandboxed harnesses needs between the four server types, reviewed together and tested with fakes: - Control plane: `release(kept)` admitted only while idle, fanned out to every participant best effort (failures returned per participant) and forwarded to every worker; export hooks receive the `checkpoint_id` they write (keyword-only); `CheckpointSettings.state_dir` for servers that record external state such as snapshots; optional `release_external_state(kept)` hooks. In-tree overrides (genrm_compare, gymnasium, workplace_assistant, example_session_state_mgmt, simple_agent, tool_simulation_agent) take the new keyword. - Per-instance checkpoint mode: `checkpoint_mode_in_effect()` on agents, resources and environment servers, read by participant setup, status/discovery and seed replies; defaults to the ClassVar. - Park signal for agent sessions: `Activation.park_requested`, `Activation.wait_park_requested()` (set by prepare, at activation entry while closed, and by retire/close; cleared by resume; never for an episode that restarts) and `Activation.queued()`, so an activation waiting for the agent's own concurrency limit counts as parked. - Agent base: a replacement attempt's seed of a restored, unclaimed session calls `_rebind_restored_agent_session_state` instead of answering 409 (the default still refuses); `_seed_restarts(body)` marks a session the agent cannot capture as a restart (header on the seed reply, never exported or waited for); `rebinds_tool_accesses` is reported with `x-ng-checkpoint-rebinds-tools`. - single_agent_turn (and the legacy flat-row server, which inherits it): the bookmark records `borrowed_sandbox` and `elapsed_s`; a restore at `invoke_agent` or `close_agent` re-seeds both sessions in a replay step (`reseed_after_restore`), so the agent re-binds to the forked sandbox; a replacement attempt only has the rest of the episode budget; resources MCP grants force a restart only when the agent seed reply does not say it re-binds tool grants. Provenance: the control-plane part of #4220 and #4222, generalized from LegacyRun to agent sessions. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Pranav Thombre <[email protected]>
Every protocol change the environment-server checkpointing of sandboxed harnesses needs between the four server types, reviewed together and tested with fakes: - Control plane: `release(kept)` admitted only while idle, fanned out to every participant best effort (failures returned per participant) and forwarded to every worker; export hooks receive the `checkpoint_id` they write (keyword-only); `CheckpointSettings.state_dir` for servers that record external state such as snapshots; optional `release_external_state(kept)` hooks. In-tree overrides (genrm_compare, gymnasium, workplace_assistant, example_session_state_mgmt, simple_agent, tool_simulation_agent) take the new keyword. - Per-instance checkpoint mode: `checkpoint_mode_in_effect()` on agents, resources and environment servers, read by participant setup, status/discovery and seed replies; defaults to the ClassVar. - Park signal for agent sessions: `Activation.park_requested`, `Activation.wait_park_requested()` (set by prepare, at activation entry while closed, and by retire/close; cleared by resume; never for an episode that restarts) and `Activation.queued()`, so an activation waiting for the agent's own concurrency limit counts as parked. - Agent base: a replacement attempt's seed of a restored, unclaimed session calls `_rebind_restored_agent_session_state` instead of answering 409 (the default still refuses); `_seed_restarts(body)` marks a session the agent cannot capture as a restart (header on the seed reply, never exported or waited for); `rebinds_tool_accesses` is reported with `x-ng-checkpoint-rebinds-tools`. - single_agent_turn (and the legacy flat-row server, which inherits it): the bookmark records `borrowed_sandbox` and `elapsed_s`; a restore at `invoke_agent` or `close_agent` re-seeds both sessions in a replay step (`reseed_after_restore`), so the agent re-binds to the forked sandbox; a replacement attempt only has the rest of the episode budget; resources MCP grants force a restart only when the agent seed reply does not say it re-binds tool grants. Provenance: the control-plane part of #4220 and #4222, generalized from LegacyRun to agent sessions. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Pranav Thombre <[email protected]>
Every protocol change the environment-server checkpointing of sandboxed harnesses needs between the four server types, reviewed together and tested with fakes: - Control plane: `release(kept)` admitted only while idle, fanned out to every participant best effort (failures returned per participant) and forwarded to every worker; export hooks receive the `checkpoint_id` they write (keyword-only); `CheckpointSettings.state_dir` for servers that record external state such as snapshots; optional `release_external_state(kept)` hooks. In-tree overrides (genrm_compare, gymnasium, workplace_assistant, example_session_state_mgmt, simple_agent, tool_simulation_agent) take the new keyword. - Per-instance checkpoint mode: `checkpoint_mode_in_effect()` on agents, resources and environment servers, read by participant setup, status/discovery and seed replies; defaults to the ClassVar. - Park signal for agent sessions: `Activation.park_requested`, `Activation.wait_park_requested()` (set by prepare, at activation entry while closed, and by retire/close; cleared by resume; never for an episode that restarts) and `Activation.queued()`, so an activation waiting for the agent's own concurrency limit counts as parked. - Agent base: a replacement attempt's seed of a restored, unclaimed session calls `_rebind_restored_agent_session_state` instead of answering 409 (the default still refuses); `_seed_restarts(body)` marks a session the agent cannot capture as a restart (header on the seed reply, never exported or waited for); `rebinds_tool_accesses` is reported with `x-ng-checkpoint-rebinds-tools`. - single_agent_turn (and the legacy flat-row server, which inherits it): the bookmark records `borrowed_sandbox` and `elapsed_s`; a restore at `invoke_agent` or `close_agent` re-seeds both sessions in a replay step (`reseed_after_restore`), so the agent re-binds to the forked sandbox; a replacement attempt only has the rest of the episode budget; resources MCP grants force a restart only when the agent seed reply does not say it re-binds tool grants. Provenance: the control-plane part of #4220 and #4222, generalized from LegacyRun to agent sessions. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Pranav Thombre <[email protected]>
Every protocol change the environment-server checkpointing of sandboxed harnesses needs between the four server types, reviewed together and tested with fakes: - Control plane: `release(kept)` admitted only while idle, fanned out to every participant best effort (failures returned per participant) and forwarded to every worker; export hooks receive the `checkpoint_id` they write (keyword-only); `CheckpointSettings.state_dir` for servers that record external state such as snapshots; optional `release_external_state(kept)` hooks. In-tree overrides (genrm_compare, gymnasium, workplace_assistant, example_session_state_mgmt, simple_agent, tool_simulation_agent) take the new keyword. - Per-instance checkpoint mode: `checkpoint_mode_in_effect()` on agents, resources and environment servers, read by participant setup, status/discovery and seed replies; defaults to the ClassVar. - Park signal for agent sessions: `Activation.park_requested`, `Activation.wait_park_requested()` (set by prepare, at activation entry while closed, and by retire/close; cleared by resume; never for an episode that restarts) and `Activation.queued()`, so an activation waiting for the agent's own concurrency limit counts as parked. - Agent base: a replacement attempt's seed of a restored, unclaimed session calls `_rebind_restored_agent_session_state` instead of answering 409 (the default still refuses); `_seed_restarts(body)` marks a session the agent cannot capture as a restart (header on the seed reply, never exported or waited for); `rebinds_tool_accesses` is reported with `x-ng-checkpoint-rebinds-tools`. - single_agent_turn (and the legacy flat-row server, which inherits it): the bookmark records `borrowed_sandbox` and `elapsed_s`; a restore at `invoke_agent` or `close_agent` re-seeds both sessions in a replay step (`reseed_after_restore`), so the agent re-binds to the forked sandbox; a replacement attempt only has the rest of the episode budget; resources MCP grants force a restart only when the agent seed reply does not say it re-binds tool grants. Provenance: the control-plane part of #4220 and #4222, generalized from LegacyRun to agent sessions. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Pranav Thombre <[email protected]>
Every protocol change the environment-server checkpointing of sandboxed harnesses needs between the four server types, reviewed together and tested with fakes: - Control plane: `release(kept)` admitted only while idle, fanned out to every participant best effort (failures returned per participant) and forwarded to every worker; export hooks receive the `checkpoint_id` they write (keyword-only); `CheckpointSettings.state_dir` for servers that record external state such as snapshots; optional `release_external_state(kept)` hooks. In-tree overrides (genrm_compare, gymnasium, workplace_assistant, example_session_state_mgmt, simple_agent, tool_simulation_agent) take the new keyword. - Per-instance checkpoint mode: `checkpoint_mode_in_effect()` on agents, resources and environment servers, read by participant setup, status/discovery and seed replies; defaults to the ClassVar. - Park signal for agent sessions: `Activation.park_requested`, `Activation.wait_park_requested()` (set by prepare, at activation entry while closed, and by retire/close; cleared by resume; never for an episode that restarts) and `Activation.queued()`, so an activation waiting for the agent's own concurrency limit counts as parked. - Agent base: a replacement attempt's seed of a restored, unclaimed session calls `_rebind_restored_agent_session_state` instead of answering 409 (the default still refuses); `_seed_restarts(body)` marks a session the agent cannot capture as a restart (header on the seed reply, never exported or waited for); `rebinds_tool_accesses` is reported with `x-ng-checkpoint-rebinds-tools`. - single_agent_turn (and the legacy flat-row server, which inherits it): the bookmark records `borrowed_sandbox` and `elapsed_s`; a restore at `invoke_agent` or `close_agent` re-seeds both sessions in a replay step (`reseed_after_restore`), so the agent re-binds to the forked sandbox; a replacement attempt only has the rest of the episode budget; resources MCP grants force a restart only when the agent seed reply does not say it re-binds tool grants. Provenance: the control-plane part of #4220 and #4222, generalized from LegacyRun to agent sessions. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Pranav Thombre <[email protected]>
…A-NeMo#5264) * feat(checkpoint): protocol for harnesses that borrow a sandbox Every protocol change the environment-server checkpointing of sandboxed harnesses needs between the four server types, reviewed together and tested with fakes: - Control plane: `release(kept)` admitted only while idle, fanned out to every participant best effort (failures returned per participant) and forwarded to every worker; export hooks receive the `checkpoint_id` they write (keyword-only); `CheckpointSettings.state_dir` for servers that record external state such as snapshots; optional `release_external_state(kept)` hooks. In-tree overrides (genrm_compare, gymnasium, workplace_assistant, example_session_state_mgmt, simple_agent, tool_simulation_agent) take the new keyword. - Per-instance checkpoint mode: `checkpoint_mode_in_effect()` on agents, resources and environment servers, read by participant setup, status/discovery and seed replies; defaults to the ClassVar. - Park signal for agent sessions: `Activation.park_requested`, `Activation.wait_park_requested()` (set by prepare, at activation entry while closed, and by retire/close; cleared by resume; never for an episode that restarts) and `Activation.queued()`, so an activation waiting for the agent's own concurrency limit counts as parked. - Agent base: a replacement attempt's seed of a restored, unclaimed session calls `_rebind_restored_agent_session_state` instead of answering 409 (the default still refuses); `_seed_restarts(body)` marks a session the agent cannot capture as a restart (header on the seed reply, never exported or waited for); `rebinds_tool_accesses` is reported with `x-ng-checkpoint-rebinds-tools`. - single_agent_turn (and the legacy flat-row server, which inherits it): the bookmark records `borrowed_sandbox` and `elapsed_s`; a restore at `invoke_agent` or `close_agent` re-seeds both sessions in a replay step (`reseed_after_restore`), so the agent re-binds to the forked sandbox; a replacement attempt only has the rest of the episode budget; resources MCP grants force a restart only when the agent seed reply does not say it re-binds tool grants. Provenance: the control-plane part of NVIDIA-NeMo#4220 and NVIDIA-NeMo#4222, generalized from LegacyRun to agent sessions. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Pranav Thombre <[email protected]> * feat(checkpoint): report a rollout's first seed in flight as a restart instead of waiting for it A rollout checkpoint lands right after a training step dispatches its rollouts, while hundreds of first seeds are still running: the resources server creating each sandbox and the agent setting its harness up in it. Prepare waited for every one, 70-80 s at 16 nodes, while every rollout already running sat parked. Such a seed has done no work of its episode worth saving. When admission closes, the agent and resources participants now record the rollouts whose first seed is still in flight and report their episodes as restarts of that checkpoint: prepare does not wait for them, and the commit leaves them out, including the sessions they register before resume. After a crash those rollouts start over from their input; the live run is unchanged, and after resume the next checkpoint captures them like any other. A seed of a session that exists, such as one re-binding a restored session to its rebuilt sandbox, still blocks prepare, so restored progress stays in the checkpoint. At 16 nodes on AgentENV (runs 8639483 and 8641901 against 8634011), steady-state checkpoints park rollouts for 7-36 s instead of 79-107 s, and leave 200-370 fewer sandboxes to snapshot. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Pranav Thombre <[email protected]> * fix(checkpoint): address the protocol review: restart parks, slots, budgets, stale releases, startup checks - A restart's activation no longer parks when it gets a slot (`queued()`) or a policy reply (`awaiting_model()`) while a checkpoint is open: nothing of it is in the checkpoint, the rule `park_requested` already applies. - `Activation.slot(semaphore)` takes one of the agent's concurrency slots in the queued scope and gives it back on every path, including a retire or close while the activation is parked holding it. - An activation keeps the restored boundary as the session's latest until it records its own, so a checkpoint taken while it waits before its first boundary exports it again instead of nothing. - The elapsed time budget is sampled when a checkpoint exports an episode (`EpisodeRecord.elapsed_s`) and charged when its replacement begins, so an agent step in flight at the cut counts in full. The per-environment `checkpoint_elapsed` / `checkpoint_charge_elapsed` helpers and `SessionHandles.elapsed_s` are gone, and so is the environment server's `checkpoint_mode_in_effect`, which nothing overrode. - An agent that grants MCP tools and does not declare `rebinds_tool_accesses` reports the restart on its own seed reply, before its session exists. single_agent_turn makes an episode that grants MCP tools without lending a sandbox a restart before seeding the agent, since only a borrowed sandbox's re-seed carries the replacement's token; its two checks of the agent's seed reply are one. - Prepare carries an earlier stage's restarts before closing admission, so no worker wakes a restart's harness first. - A release for a checkpoint older than the latest one a participant resumed is refused as stale. - Startup refuses an export hook that cannot take `checkpoint_id` and an agent that declares `rebinds_tool_accesses` without overriding the re-bind hook. - Docs: the `release_external_state` contract on both hooks, the MCP and re-seed behaviour in the single_agent_turn README, and `release` among the traced checkpoint operations. Tests cover each, plus the gaps the review found: the borrowed-sandbox flag recorded by a real seed and a checkpoint not waiting for the re-seed, the real resources release by mode and the export's checkpoint ID (one and two workers), the retire and close wake-up of a park wait in a task of its own, and the default re-bind gate. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Pranav Thombre <[email protected]> * fix(checkpoint): address the second protocol review: release contract, stale releases, restart rules, names - `release` returns only once the external state is deleted, under the control lock and the request deadline. The participant docstring no longer allows returning before. - A release is stale once the participant committed or restored a checkpoint after the one it names. A checkpoint aborted there no longer counts, so the release that ends a run is admitted after an abort. Once a process holds a checkpoint, a release that names one it never resumed is stale too, since it dates from before a restart. A release names the latest checkpoint the controller resumed. - Status and discovery report `keeps_external_state`, so a controller that never releases can refuse to run or warn. - A session granted MCP tools the agent cannot re-bind, or lent a sandbox the agent cannot re-bind, restarts whatever `_seed_restarts` returns: the hook only adds restarts, and its default adds none. - With several workers a release fails unless every expected worker answered. - The participants check that the export hook takes `checkpoint_id` when they are built, so code that builds one around its own hooks learns it at startup too. - `EpisodeRecord` leaves `elapsed_s` out when nothing was spent, so a Gym from before the field restores the record. - Names: the hook is `delete_external_state` and the docstrings say delete; the participants' first-seed restarts are `_first_seed_restarts`; the header is `x-ng-checkpoint-rebinds-tool-accesses` and its reader `seed_rebinds_tool_accesses`; "the cut" no longer names the moment a checkpoint exports an episode. - Docs: `release` is listed among the control operations in the metrics page and the telemetry docstrings. Tests cover each, plus the resources participant gaps the review found: a release between a restore and its resume, resume clearing the first-seed restarts, and a seed that claims a restored session blocking prepare. Co-Authored-By: Claude Fable 5.2 <[email protected]> Signed-off-by: Pranav Thombre <[email protected]> * test(checkpoint): seed without a lent sandbox where an agent that does not re-bind exports the session An agent that does not re-bind restored sessions now restarts a session lent a sandbox, so the tests of its restored sessions and of its MCP restart seed a session without one. The test of a seed that claims a restored session reads the phase of the prepare it holds up, and the test of an overriding restart hook seeds its second session on its own client. Co-Authored-By: Claude Fable 5.2 <[email protected]> Signed-off-by: Pranav Thombre <[email protected]> * test(checkpoint): a server with several workers reports keeps_external_state, and discover carries it Co-Authored-By: Claude Fable 5.2 <[email protected]> Signed-off-by: Pranav Thombre <[email protected]> --------- Signed-off-by: Pranav Thombre <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
What changed and why
An agent harness such as OpenCode, Codex, or Claude Code runs a whole rollout as one process inside a sandbox. A legacy
/runagent that wraps it sees no boundary between the harness's start and its end: to Gym the harness is onewaitstep, and a checkpoint waits for awaitstep to finish. Meanwhile the policy model server holds every new model call until resume. So the harness's next model call waits for the checkpoint, the checkpoint waits for the harness, and prepare can only miss its deadline. Marking the stepreplaydoes not help: the harness keeps changing the sandbox while its owner snapshots it, and after a crash the step would run again from the start in a sandbox that already holds half its work. Until now such an agent could only be restart-only and lose its rollout on every crash.This PR adds a park request: a way for a checkpoint to ask a run to stop a long
waitstep at a safe point. The run stops the harness, records a boundary that says how to continue it, and parks there, so the checkpoint is taken within its deadline. The run continues the harness after the resume, or the replacement attempt does after a crash.EpisodeStepsraises the park request when a checkpoint closes admission and withdraws it when admission reopens, on resume or when a prepare that missed its deadline reopens it. A run reads it throughLegacyRun.park_requestedand waits for it withawait LegacyRun.wait_park_requested(), which returns at once if the request is already raised. Neither lets a run raise or withdraw the request. A restart run, which a checkpoint never waits for, is not asked to park.waitstep that may outlast a checkpoint's deadline waits for its work and for the park request together. On a park request it stops the work at a safe point (for a harness, it signals the harness so that it saves its session and exits), leaves the step, and records a boundary that continues the work, for example{"next": "harness", "continue": true, "sandbox_handle": ...}. A boundary recorded while admission is closed parks the run until resume, so the run no longer blocks prepare, and the commit exports that boundary. After resume the same run continues from it; after a crash the replacement attempt receives it as its continuation. Continuing must depend only on what the checkpoint captures: a harness keeps its session on the sandbox filesystem, which the sandbox's owner snapshots at commit, and is relaunched with its own resume option, such asopencode run --continue./sandbox_access(feat(sandbox): sandbox and snapshot lifecycle for partial-rollout checkpoints #4220), instead of reusing the handle in its boundary, which names the sandbox the crashed process used.fake_harness_agentis a legacy/runagent shaped like the OpenCode agent: seed (replay), harness (wait), verify. Its harness isrun notes <n>in the fake sandbox backend, which appends a line every interval and continues from the lines the file already holds, asopencode run --continueresumes a session;interrupt notesstops it, as SIGINT stops OpenCode. The notes resources server from feat(checkpoint): process-level evidence for resources-owned sandbox checkpoints, their release, and lease expiry #4221 owns and checkpoints the sandbox; it now implementscurrent_sandbox_access, and its seed reply to a legacy/runnames the sandbox. The e2e deployment gains theharnesstopology. Scenarios:releasedeletes the snapshot;The OpenCode agent adopts this protocol in #4274.
How it works
Where this PR sits in the overall flow
The highlighted part is what this PR adds.
flowchart LR C["Controller<br/>NeMo RL"] CO["Coordination<br/>prepare, commit, restore, resume,<br/>retire, release"] K["Control plane on every server"] subgraph G["One participant per Gym server"] E["Environment server<br/>episode steps"] M["Policy model<br/>holds new calls until resume"] A["Agent<br/>legacy runs: park request,<br/>boundary that continues the harness"] R["Resources server<br/>owns the sandbox: snapshot, fork,<br/>/sandbox_access"] end H["Harness in the sandbox<br/>OpenCode, Codex, Claude Code"] D[("Checkpoint directory")] C --> CO --> K K --> E & M & A & R A -- "launch, interrupt, relaunch with continue" --> H R -- "snapshot at commit, fork at restore" --> H G --> D classDef this fill:#fde68a,stroke:#b45309,stroke-width:2px,color:#1f2937 class A thisOne checkpoint of a harness run
sequenceDiagram participant C as Controller participant P as Agent participant participant R as Agent /run participant H as Harness in the sandbox participant S as Resources server R->>H: launch, inside a wait step C->>P: prepare Note over P: admission closes, park request raised P-->>R: wait_park_requested returns R->>H: SIGINT, then SIGKILL after a grace period Note over H: saves its session on the sandbox filesystem and exits Note over R: leaves the wait step, records boundary next=harness continue=true,<br/>parks there until resume P-->>C: prepared C->>P: commit Note over P: exports the run's boundary C->>S: commit Note over S: snapshots the sandbox: the repository and the harness session alt checkpoint and continue C->>P: resume Note over P: park request withdrawn, the run wakes R->>S: /sandbox_access S-->>R: the same sandbox R->>H: relaunch with continue else crash, then restore C->>S: restore: fork the snapshot under a new id C->>P: restore the boundary, then resume Note over R: the replacement attempt starts at the boundary R->>S: /sandbox_access S-->>R: the fork R->>H: relaunch with continue, in the fork endThe run's harness step
Where this sits in the stack
This PR is one of a series that adds sandbox checkpointing on top of the partial-rollout checkpointing stack, whose top is #4197 (
ananthsub/partial-ckpt-fault-tests). Each PR is one commit, and its base is the branch of the PR before it.pthombre/partial-ckpt-sandbox-core): the sandbox session checkpointer, thereleaseprotocol, the snapshot index, the OpenSandbox lease, and/sandbox_accesspthombre/partial-ckpt-sandbox-resources): process-level evidence for resources-owned sandbox checkpoints and their releasepthombre/partial-ckpt-sandbox-agent): this PRpthombre/partial-ckpt-sandbox-swebench): the sandbox owner base, with the SWE-bench resources server on itpthombre/partial-ckpt-sandbox-opencode): the harness driver, with the OpenCode agent on itpthombre/partial-ckpt-sandbox-capture): calls a checkpoint abandoned stay out of the capture ledgerIssue
No tracking issue exists for this series; #4220 describes the design.
Validation
Run in the r3Run nemo-rl+Gym container on Slurm against this head, on
ananthsub/partial-ckpt-fault-tests8947bb2ca(job 1289959 suites, job 1289960 e2e):tests/unit_tests/test_checkpoint_agent.py, including:waitstep blocks prepare, the park request interrupts it, prepare becomes ready, the commit exports the boundary that continues it, and resume withdraws the request;wait_park_requestedreturns at once when the request is already raised;tests/e2e/checkpointwithNEMO_GYM_CHECKPOINT_E2E=1: 61 passed, 12 skipped (real-model and scale cases), including the three harness scenarios above.tests/unit_tests/test_checkpoint_*.py783 passed; sandbox 212 passed; Simple Agent 73, rollout collection and the session-state and single-turn examples 515 passed.ruff checkandruff format --check(ruff 0.9.9) clean on the changed files. Every commit carries aSigned-off-byline.Rollout evidence
opencode run --continue, finished, and verified (job 1172174); later runs addedreleaseand the lease (jobs 1241245, 1245200). On this series' tip (job 1253315): prepare interrupted the 2 running OpenCode rollouts in 5.6 s with no blockers, the commit snapshotted their sandboxes in 19.4 s, Gym was killed with one rollout still running, the restore took 6.9 s, the replacement continued in the fork withopencode run --continueand verified, and a finalreleasedeleted both snapshots from the cell.Compatibility
LegacyRun.park_requestedandLegacyRun.wait_park_requested(). An agent that does not use them is unchanged: a checkpoint waits for itswaitsteps as before.checkpoint:block setsenabled: true.harnesse2e topology,fake_harness_agent, the fake backend'srunandinterruptcommands, and the notes server'scurrent_sandbox_accessand legacy seedsandbox_handle.🤖 Generated with Claude Code