Skip to content

feat(checkpoint): resume proof refinement agent turns - #3634

Draft
zyzhou5 wants to merge 4 commits into
NVIDIA-NeMo:amahishi/gym-prefix-cuts-lineagefrom
zyzhou5:zezhou/proof-refinement-checkpoint-state
Draft

zyzhou5 wants to merge 4 commits into
NVIDIA-NeMo:amahishi/gym-prefix-cuts-lineagefrom
zyzhou5:zezhou/proof-refinement-checkpoint-state

Conversation

@zyzhou5

@zyzhou5 zyzhou5 commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Add partial-rollout checkpoint support to ProofRefinementAgent in app.py. After recovery, the agent reuses a saved proof for pending verification or continues with the next correction, preserving earlier attempts instead of restarting the task.

Validation

Validated the rebased head 175ad5da on base 90ff732e: 299 tests passed, covering proof-agent save/restore, Lean verification, and the shared agent/checkpoint configuration. The existing Python environment was isolated from its older editable checkout, and imports were checked against the rebased worktree. Exact pytest invocation:

Rollouts

Ran a training/recovery experiment on OCI-HSG with Qwen3-4B-Instruct-2507 and the Lean compiler: original job 7391785, separate resume job 7391786.

  • Saved a coordinated checkpoint at training step 1, after the selected rollout's first proof failed verification and before it generated a correction.
  • Let the original job continue; restored that checkpoint in fresh processes in the second job. Both finished training step 3 with exit code 0.
  • Compared the saved proof history, compiler feedback, correction input, and cookies. The resumed rollout generated only the correction and produced the same compiler-accepted proof and reward of 1. It did not repeat the first attempt or rerun its already completed sibling.

This run used Gym 72e1ed988 on base 8a51b311, with test instrumentation and NeMo-RL 3ac4a1fc containing checkpoint compatibility fixes.

@copy-pr-bot

copy-pr-bot Bot commented Sep 22, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@zyzhou5
zyzhou5 changed the base branch from main to amahishi/gym-turn-level-recovery September 22, 2026 22:19
@zyzhou5
zyzhou5 changed the base branch from amahishi/gym-turn-level-recovery to amahishi/gym-prefix-cuts-lineage September 22, 2026 22:20
@yaoyu-33 yaoyu-33 added area:agent Agent harnesses and Responses API agent behavior complexity:medium Single-domain change with interacting parts or a moderate review surface feature New capabilities, enhancements, or enablement work needs-review PR is ready for code review and waiting on a reviewer labels Sep 22, 2026
@macandro96
macandro96 force-pushed the amahishi/gym-prefix-cuts-lineage branch from 1458187 to 82c4f15 Compare September 23, 2026 00:36
@github-actions github-actions Bot added the sla:triage-overdue Review assignment is over the one-business-day SLA label Sep 23, 2026
@zyzhou5
zyzhou5 force-pushed the zezhou/proof-refinement-checkpoint-state branch from fcb40b8 to c508883 Compare September 23, 2026 23:35
@macandro96
macandro96 force-pushed the amahishi/gym-prefix-cuts-lineage branch from 8a51b31 to 90ff732 Compare September 28, 2026 20:58
@zyzhou5
zyzhou5 force-pushed the zezhou/proof-refinement-checkpoint-state branch from 72e1ed9 to 175ad5d Compare September 28, 2026 21:31
@macandro96
macandro96 force-pushed the amahishi/gym-prefix-cuts-lineage branch from 90ff732 to 76747e0 Compare September 29, 2026 04:40
Save proof attempts, pending verification, correction inputs, cookies, and model-call lineage through the shared legacy agent checkpoint machinery. Declare Lean verification stateless and enable replayable verification in its multi-turn configuration.

Validation on the updated prefix-recovery base: 148 focused tests passed; ProofRefinementAgent coverage 98.81%; changed-file pre-commit checks passed. The combined coverage gate remains below 96% because Lean retains the same 23 uncovered utility lines as the original base. Real-model end-to-end recovery testing is deferred.

Signed-off-by: Zeyu Zhou <[email protected]>
Correction prompts replace the prior conversation, so discard the inherited checkpoint parent before generating a correction while preserving saved boundary coordinates. Exercise the actual token-capture parent resolver across restore and repeated-checkpoint boundaries. Validation: 152 tests passed; ProofRefinementAgent coverage 98.82%; targeted pre-commit passed.

Signed-off-by: Zeyu Zhou <[email protected]>
Adapt the proof recovery harness to the shared run response format and check its completion receipt against the checkpoint participant. Keep ordinary runs using their existing response model.

Signed-off-by: Zeyu Zhou <[email protected]>
@zyzhou5
zyzhou5 force-pushed the zezhou/proof-refinement-checkpoint-state branch from 175ad5d to c066190 Compare September 29, 2026 16:50
ananthsub added a commit that referenced this pull request Oct 1, 2026
…undaries

The proof refinement agent runs its own seed, generate, verify, and
correct loop inside a legacy /run, so until now every checkpoint had to
retire its rollouts and restart them from the task input. It now runs
under the agent participant's legacy_run and records a boundary before
seeding, before each generation, before each verification, and once it
has its final result. A restored attempt continues from that boundary:
it skips the seed, keeps the completed attempts, and never regenerates
a proof that was already generated.

- Seeding and generation are replay steps. Verification uses the mode
  the resources server reports on its seed reply.
- The agent's /v1/responses proxy passes the policy model's 409
  checkpoint_parked through to /run instead of failing. /run backs off,
  returns to the boundary before the generation, and parks there once
  the agent's own admission closes.
- The session hooks are no-ops: the boundary holds the whole episode.

math_formal_lean compiles each proof on its own in a stateless sandbox,
so it declares checkpoint_mode = "stateless" and checkpoint_verify =
"replay".

Ported from #3634 onto the v2 checkpoint hooks. The
capture-outcome handling (failing on capture_failed, masking
no_generation), the model-call coordinates, the resource request IDs
and revisions, and the explicit fresh-parent call for correction turns
are not carried: the first two depend on token-capture changes that
are not on this stack, and the rest are gone from the v2 design.

Signed-off-by: Ananth Subramaniam <[email protected]>
ananthsub added a commit that referenced this pull request Oct 1, 2026
…undaries

The proof refinement agent runs its own seed, generate, verify, and
correct loop inside a legacy /run, so until now every checkpoint had to
retire its rollouts and restart them from the task input. It now runs
under the agent participant's legacy_run and records a boundary before
seeding, before each generation, before each verification, and once it
has its final result. A restored attempt continues from that boundary:
it skips the seed, keeps the completed attempts, and never regenerates
a proof that was already generated.

- Seeding and generation are replay steps. Verification uses the mode
  the resources server reports on its seed reply.
- The agent's /v1/responses proxy passes the policy model's 409
  checkpoint_parked through to /run instead of failing. /run backs off,
  returns to the boundary before the generation, and parks there once
  the agent's own admission closes.
- The session hooks are no-ops: the boundary holds the whole episode.

math_formal_lean compiles each proof on its own in a stateless sandbox,
so it declares checkpoint_mode = "stateless" and checkpoint_verify =
"replay".

Ported from #3634 onto the v2 checkpoint hooks. The
capture-outcome handling (failing on capture_failed, masking
no_generation), the model-call coordinates, the resource request IDs
and revisions, and the explicit fresh-parent call for correction turns
are not carried: the first two depend on token-capture changes that
are not on this stack, and the rest are gone from the v2 design.

Signed-off-by: Ananth Subramaniam <[email protected]>
ananthsub added a commit that referenced this pull request Oct 2, 2026
…undaries

The proof refinement agent runs its own seed, generate, verify, and
correct loop inside a legacy /run, so until now every checkpoint had to
retire its rollouts and restart them from the task input. It now runs
under the agent participant's legacy_run and records a boundary before
seeding, before each generation, before each verification, and once it
has its final result. A restored attempt continues from that boundary:
it skips the seed, keeps the completed attempts, and never regenerates
a proof that was already generated.

- Seeding and generation are replay steps. Verification uses the mode
  the resources server reports on its seed reply.
- The agent's /v1/responses proxy passes the policy model's 409
  checkpoint_parked through to /run instead of failing. /run backs off,
  returns to the boundary before the generation, and parks there once
  the agent's own admission closes.
- The session hooks are no-ops: the boundary holds the whole episode.

math_formal_lean compiles each proof on its own in a stateless sandbox,
so it declares checkpoint_mode = "stateless" and checkpoint_verify =
"replay".

Ported from #3634 onto the v2 checkpoint hooks. The
capture-outcome handling (failing on capture_failed, masking
no_generation), the model-call coordinates, the resource request IDs
and revisions, and the explicit fresh-parent call for correction turns
are not carried: the first two depend on token-capture changes that
are not on this stack, and the rest are gone from the v2 design.

Signed-off-by: Ananth Subramaniam <[email protected]>
ananthsub added a commit that referenced this pull request Oct 2, 2026
…undaries

The proof refinement agent runs its own seed, generate, verify, and
correct loop inside a legacy /run, so until now every checkpoint had to
retire its rollouts and restart them from the task input. It now runs
under the agent participant's legacy_run and records a boundary before
seeding, before each generation, before each verification, and once it
has its final result. A restored attempt continues from that boundary:
it skips the seed, keeps the completed attempts, and never regenerates
a proof that was already generated.

- Seeding and generation are replay steps. Verification uses the mode
  the resources server reports on its seed reply.
- The agent's /v1/responses proxy passes the policy model's 409
  checkpoint_parked through to /run instead of failing. /run backs off,
  returns to the boundary before the generation, and parks there once
  the agent's own admission closes.
- The session hooks are no-ops: the boundary holds the whole episode.

math_formal_lean compiles each proof on its own in a stateless sandbox,
so it declares checkpoint_mode = "stateless" and checkpoint_verify =
"replay".

Ported from #3634 onto the v2 checkpoint hooks. The
capture-outcome handling (failing on capture_failed, masking
no_generation), the model-call coordinates, the resource request IDs
and revisions, and the explicit fresh-parent call for correction turns
are not carried: the first two depend on token-capture changes that
are not on this stack, and the rest are gone from the v2 design.

Signed-off-by: Ananth Subramaniam <[email protected]>
ananthsub added a commit that referenced this pull request Oct 2, 2026
…undaries

The proof refinement agent runs its own seed, generate, verify, and
correct loop inside a legacy /run, so until now every checkpoint had to
retire its rollouts and restart them from the task input. It now runs
under the agent participant's legacy_run and records a boundary before
seeding, before each generation, before each verification, and once it
has its final result. A restored attempt continues from that boundary:
it skips the seed, keeps the completed attempts, and never regenerates
a proof that was already generated.

- Seeding and generation are replay steps. Verification uses the mode
  the resources server reports on its seed reply.
- The agent's /v1/responses proxy passes the policy model's 409
  checkpoint_parked through to /run instead of failing. /run backs off,
  returns to the boundary before the generation, and parks there once
  the agent's own admission closes.
- The session hooks are no-ops: the boundary holds the whole episode.

math_formal_lean compiles each proof on its own in a stateless sandbox,
so it declares checkpoint_mode = "stateless" and checkpoint_verify =
"replay".

Ported from #3634 onto the v2 checkpoint hooks. The
capture-outcome handling (failing on capture_failed, masking
no_generation), the model-call coordinates, the resource request IDs
and revisions, and the explicit fresh-parent call for correction turns
are not carried: the first two depend on token-capture changes that
are not on this stack, and the rest are gone from the v2 design.

Signed-off-by: Ananth Subramaniam <[email protected]>
ananthsub added a commit that referenced this pull request Oct 2, 2026
…undaries

The proof refinement agent runs its own seed, generate, verify, and
correct loop inside a legacy /run, so until now every checkpoint had to
retire its rollouts and restart them from the task input. It now runs
under the agent participant's legacy_run and records a boundary before
seeding, before each generation, before each verification, and once it
has its final result. A restored attempt continues from that boundary:
it skips the seed, keeps the completed attempts, and never regenerates
a proof that was already generated.

- Seeding and generation are replay steps. Verification uses the mode
  the resources server reports on its seed reply.
- The agent's /v1/responses proxy passes the policy model's 409
  checkpoint_parked through to /run instead of failing. /run backs off,
  returns to the boundary before the generation, and parks there once
  the agent's own admission closes.
- The session hooks are no-ops: the boundary holds the whole episode.

math_formal_lean compiles each proof on its own in a stateless sandbox,
so it declares checkpoint_mode = "stateless" and checkpoint_verify =
"replay".

Ported from #3634 onto the v2 checkpoint hooks. The
capture-outcome handling (failing on capture_failed, masking
no_generation), the model-call coordinates, the resource request IDs
and revisions, and the explicit fresh-parent call for correction turns
are not carried: the first two depend on token-capture changes that
are not on this stack, and the rest are gone from the v2 design.

Signed-off-by: Ananth Subramaniam <[email protected]>
ananthsub added a commit that referenced this pull request Oct 6, 2026
…undaries

The proof refinement agent runs its own seed, generate, verify, and
correct loop inside a legacy /run, so until now every checkpoint had to
retire its rollouts and restart them from the task input. It now runs
under the agent participant's legacy_run and records a boundary before
seeding, before each generation, before each verification, and once it
has its final result. A restored attempt continues from that boundary:
it skips the seed, keeps the completed attempts, and never regenerates
a proof that was already generated.

- Seeding and generation are replay steps. Verification uses the mode
  the resources server reports on its seed reply.
- The agent's /v1/responses proxy passes the policy model's 409
  checkpoint_parked through to /run instead of failing. /run backs off,
  returns to the boundary before the generation, and parks there once
  the agent's own admission closes.
- The session hooks are no-ops: the boundary holds the whole episode.

math_formal_lean compiles each proof on its own in a stateless sandbox,
so it declares checkpoint_mode = "stateless" and checkpoint_verify =
"replay".

Ported from #3634 onto the v2 checkpoint hooks. The
capture-outcome handling (failing on capture_failed, masking
no_generation), the model-call coordinates, the resource request IDs
and revisions, and the explicit fresh-parent call for correction turns
are not carried: the first two depend on token-capture changes that
are not on this stack, and the rest are gone from the v2 design.

Signed-off-by: Ananth Subramaniam <[email protected]>
ananthsub added a commit that referenced this pull request Oct 6, 2026
…undaries

The proof refinement agent runs its own seed, generate, verify, and
correct loop inside a legacy /run, so until now every checkpoint had to
retire its rollouts and restart them from the task input. It now runs
under the agent participant's legacy_run and records a boundary before
seeding, before each generation, before each verification, and once it
has its final result. A restored attempt continues from that boundary:
it skips the seed, keeps the completed attempts, and never regenerates
a proof that was already generated.

- Seeding and generation are replay steps. Verification uses the mode
  the resources server reports on its seed reply.
- The agent's /v1/responses proxy passes the policy model's 409
  admission_closed through to /run instead of failing. /run backs off,
  returns to the boundary before the generation, and parks there once
  the agent's own admission closes.
- The session hooks are no-ops: the boundary holds the whole episode.

math_formal_lean compiles each proof on its own in a stateless sandbox,
so it declares checkpoint_mode = "stateless" and checkpoint_verify =
"replay".

Ported from #3634 onto the v2 checkpoint hooks. The
capture-outcome handling (failing on capture_failed, masking
no_generation), the model-call coordinates, the resource request IDs
and revisions, and the explicit fresh-parent call for correction turns
are not carried: the first two depend on token-capture changes that
are not on this stack, and the rest are gone from the v2 design.

Signed-off-by: Ananth Subramaniam <[email protected]>
ananthsub added a commit that referenced this pull request Oct 7, 2026
…undaries

The proof refinement agent runs its own seed, generate, verify, and
correct loop inside a legacy /run, so until now every checkpoint had to
retire its rollouts and restart them from the task input. It now runs
under the agent participant's legacy_run and records a boundary before
seeding, before each generation, before each verification, and once it
has its final result. A restored attempt continues from that boundary:
it skips the seed, keeps the completed attempts, and never regenerates
a proof that was already generated.

- Seeding and generation are replay steps. Verification uses the mode
  the resources server reports on its seed reply.
- The agent's /v1/responses proxy passes the policy model's 409
  admission_closed through to /run instead of failing. /run backs off,
  returns to the boundary before the generation, and parks there once
  the agent's own admission closes.
- The session hooks are no-ops: the boundary holds the whole episode.

math_formal_lean compiles each proof on its own in a stateless sandbox,
so it declares checkpoint_mode = "stateless" and checkpoint_verify =
"replay".

Ported from #3634 onto the v2 checkpoint hooks. The
capture-outcome handling (failing on capture_failed, masking
no_generation), the model-call coordinates, the resource request IDs
and revisions, and the explicit fresh-parent call for correction turns
are not carried: the first two depend on token-capture changes that
are not on this stack, and the rest are gone from the v2 design.

Signed-off-by: Ananth Subramaniam <[email protected]>
ananthsub added a commit that referenced this pull request Oct 8, 2026
…undaries

The proof refinement agent runs its own seed, generate, verify, and
correct loop inside a legacy /run, so until now every checkpoint had to
retire its rollouts and restart them from the task input. It now runs
under the agent participant's legacy_run and records a boundary before
seeding, before each generation, before each verification, and once it
has its final result. A restored attempt continues from that boundary:
it skips the seed, keeps the completed attempts, and never regenerates
a proof that was already generated.

- Seeding and generation are replay steps. Verification uses the mode
  the resources server reports on its seed reply.
- The agent's /v1/responses proxy passes the policy model's 409
  admission_closed through to /run instead of failing. /run backs off,
  returns to the boundary before the generation, and parks there once
  the agent's own admission closes.
- The session hooks are no-ops: the boundary holds the whole episode.

math_formal_lean compiles each proof on its own in a stateless sandbox,
so it declares checkpoint_mode = "stateless" and checkpoint_verify =
"replay".

Ported from #3634 onto the v2 checkpoint hooks. The
capture-outcome handling (failing on capture_failed, masking
no_generation), the model-call coordinates, the resource request IDs
and revisions, and the explicit fresh-parent call for correction turns
are not carried: the first two depend on token-capture changes that
are not on this stack, and the rest are gone from the v2 design.

Signed-off-by: Ananth Subramaniam <[email protected]>
ananthsub added a commit that referenced this pull request Oct 8, 2026
…undaries

The proof refinement agent runs its own seed, generate, verify, and
correct loop inside a legacy /run, so until now every checkpoint had to
retire its rollouts and restart them from the task input. It now runs
under the agent participant's legacy_run and records a boundary before
seeding, before each generation, before each verification, and once it
has its final result. A restored attempt continues from that boundary:
it skips the seed, keeps the completed attempts, and never regenerates
a proof that was already generated.

- Seeding and generation are replay steps. Verification uses the mode
  the resources server reports on its seed reply.
- The agent's /v1/responses proxy passes the policy model's 409
  admission_closed through to /run instead of failing. /run backs off,
  returns to the boundary before the generation, and parks there once
  the agent's own admission closes.
- The session hooks are no-ops: the boundary holds the whole episode.

math_formal_lean compiles each proof on its own in a stateless sandbox,
so it declares checkpoint_mode = "stateless" and checkpoint_verify =
"replay".

Ported from #3634 onto the v2 checkpoint hooks. The
capture-outcome handling (failing on capture_failed, masking
no_generation), the model-call coordinates, the resource request IDs
and revisions, and the explicit fresh-parent call for correction turns
are not carried: the first two depend on token-capture changes that
are not on this stack, and the rest are gone from the v2 design.

Signed-off-by: Ananth Subramaniam <[email protected]>
ananthsub added a commit that referenced this pull request Oct 9, 2026
…undaries

The proof refinement agent runs its own seed, generate, verify, and
correct loop inside a legacy /run, so until now every checkpoint had to
retire its rollouts and restart them from the task input. It now runs
under the agent participant's legacy_run and records a boundary before
seeding, before each generation, before each verification, and once it
has its final result. A restored attempt continues from that boundary:
it skips the seed, keeps the completed attempts, and never regenerates
a proof that was already generated.

- Seeding and generation are replay steps. Verification uses the mode
  the resources server reports on its seed reply.
- The agent's /v1/responses proxy passes the policy model's 409
  admission_closed through to /run instead of failing. /run backs off,
  returns to the boundary before the generation, and parks there once
  the agent's own admission closes.
- The session hooks are no-ops: the boundary holds the whole episode.

math_formal_lean compiles each proof on its own in a stateless sandbox,
so it declares checkpoint_mode = "stateless" and checkpoint_verify =
"replay".

Ported from #3634 onto the v2 checkpoint hooks. The
capture-outcome handling (failing on capture_failed, masking
no_generation), the model-call coordinates, the resource request IDs
and revisions, and the explicit fresh-parent call for correction turns
are not carried: the first two depend on token-capture changes that
are not on this stack, and the rest are gone from the v2 design.

Signed-off-by: Ananth Subramaniam <[email protected]>
ananthsub added a commit that referenced this pull request Oct 9, 2026
…undaries

The proof refinement agent runs its own seed, generate, verify, and
correct loop inside a legacy /run, so until now every checkpoint had to
retire its rollouts and restart them from the task input. It now runs
under the agent participant's legacy_run and records a boundary before
seeding, before each generation, before each verification, and once it
has its final result. A restored attempt continues from that boundary:
it skips the seed, keeps the completed attempts, and never regenerates
a proof that was already generated.

- Seeding and generation are replay steps. Verification uses the mode
  the resources server reports on its seed reply.
- The agent's /v1/responses proxy passes the policy model's 409
  admission_closed through to /run instead of failing. /run backs off,
  returns to the boundary before the generation, and parks there once
  the agent's own admission closes.
- The session hooks are no-ops: the boundary holds the whole episode.

math_formal_lean compiles each proof on its own in a stateless sandbox,
so it declares checkpoint_mode = "stateless" and checkpoint_verify =
"replay".

Ported from #3634 onto the v2 checkpoint hooks. The
capture-outcome handling (failing on capture_failed, masking
no_generation), the model-call coordinates, the resource request IDs
and revisions, and the explicit fresh-parent call for correction turns
are not carried: the first two depend on token-capture changes that
are not on this stack, and the rest are gone from the v2 design.

Signed-off-by: Ananth Subramaniam <[email protected]>
ananthsub added a commit that referenced this pull request Oct 9, 2026
…undaries

The proof refinement agent runs its own seed, generate, verify, and
correct loop inside a legacy /run, so until now every checkpoint had to
retire its rollouts and restart them from the task input. It now runs
under the agent participant's legacy_run and records a boundary before
seeding, before each generation, before each verification, and once it
has its final result. A restored attempt continues from that boundary:
it skips the seed, keeps the completed attempts, and never regenerates
a proof that was already generated.

- Seeding and generation are replay steps. Verification uses the mode
  the resources server reports on its seed reply.
- The agent's /v1/responses proxy passes the policy model's 409
  admission_closed through to /run instead of failing. /run backs off,
  returns to the boundary before the generation, and parks there once
  the agent's own admission closes.
- The session hooks are no-ops: the boundary holds the whole episode.

math_formal_lean compiles each proof on its own in a stateless sandbox,
so it declares checkpoint_mode = "stateless" and checkpoint_verify =
"replay".

Ported from #3634 onto the v2 checkpoint hooks. The
capture-outcome handling (failing on capture_failed, masking
no_generation), the model-call coordinates, the resource request IDs
and revisions, and the explicit fresh-parent call for correction turns
are not carried: the first two depend on token-capture changes that
are not on this stack, and the rest are gone from the v2 design.

Signed-off-by: Ananth Subramaniam <[email protected]>
ananthsub added a commit that referenced this pull request Oct 10, 2026
…undaries

The proof refinement agent runs its own seed, generate, verify, and
correct loop inside a legacy /run, so until now every checkpoint had to
retire its rollouts and restart them from the task input. It now runs
under the agent participant's legacy_run and records a boundary before
seeding, before each generation, before each verification, and once it
has its final result. A restored attempt continues from that boundary:
it skips the seed, keeps the completed attempts, and never regenerates
a proof that was already generated.

- Seeding and generation are replay steps. Verification uses the mode
  the resources server reports on its seed reply.
- The agent's /v1/responses proxy passes the policy model's 409
  admission_closed through to /run instead of failing. /run backs off,
  returns to the boundary before the generation, and parks there once
  the agent's own admission closes.
- The session hooks are no-ops: the boundary holds the whole episode.

math_formal_lean compiles each proof on its own in a stateless sandbox,
so it declares checkpoint_mode = "stateless" and checkpoint_verify =
"replay".

Ported from #3634 onto the v2 checkpoint hooks. The
capture-outcome handling (failing on capture_failed, masking
no_generation), the model-call coordinates, the resource request IDs
and revisions, and the explicit fresh-parent call for correction turns
are not carried: the first two depend on token-capture changes that
are not on this stack, and the rest are gone from the v2 design.

Signed-off-by: Ananth Subramaniam <[email protected]>
ananthsub added a commit that referenced this pull request Oct 10, 2026
…undaries

The proof refinement agent runs its own seed, generate, verify, and
correct loop inside a legacy /run, so until now every checkpoint had to
retire its rollouts and restart them from the task input. It now runs
under the agent participant's legacy_run and records a boundary before
seeding, before each generation, before each verification, and once it
has its final result. A restored attempt continues from that boundary:
it skips the seed, keeps the completed attempts, and never regenerates
a proof that was already generated.

- Seeding and generation are replay steps. Verification uses the mode
  the resources server reports on its seed reply.
- The agent's /v1/responses proxy passes the policy model's 409
  admission_closed through to /run instead of failing. /run backs off,
  returns to the boundary before the generation, and parks there once
  the agent's own admission closes.
- The session hooks are no-ops: the boundary holds the whole episode.

math_formal_lean compiles each proof on its own in a stateless sandbox,
so it declares checkpoint_mode = "stateless" and checkpoint_verify =
"replay".

Ported from #3634 onto the v2 checkpoint hooks. The
capture-outcome handling (failing on capture_failed, masking
no_generation), the model-call coordinates, the resource request IDs
and revisions, and the explicit fresh-parent call for correction turns
are not carried: the first two depend on token-capture changes that
are not on this stack, and the rest are gone from the v2 design.

Signed-off-by: Ananth Subramaniam <[email protected]>
ananthsub added a commit that referenced this pull request Oct 12, 2026
…undaries

The proof refinement agent runs its own seed, generate, verify, and
correct loop inside a legacy /run, so until now every checkpoint had to
retire its rollouts and restart them from the task input. It now runs
under the agent participant's legacy_run and records a boundary before
seeding, before each generation, before each verification, and once it
has its final result. A restored attempt continues from that boundary:
it skips the seed, keeps the completed attempts, and never regenerates
a proof that was already generated.

- Seeding and generation are replay steps. Verification uses the mode
  the resources server reports on its seed reply.
- The agent's /v1/responses proxy passes the policy model's 409
  admission_closed through to /run instead of failing. /run backs off,
  returns to the boundary before the generation, and parks there once
  the agent's own admission closes.
- The session hooks are no-ops: the boundary holds the whole episode.

math_formal_lean compiles each proof on its own in a stateless sandbox,
so it declares checkpoint_mode = "stateless" and checkpoint_verify =
"replay".

Ported from #3634 onto the v2 checkpoint hooks. The
capture-outcome handling (failing on capture_failed, masking
no_generation), the model-call coordinates, the resource request IDs
and revisions, and the explicit fresh-parent call for correction turns
are not carried: the first two depend on token-capture changes that
are not on this stack, and the rest are gone from the v2 design.

Signed-off-by: Ananth Subramaniam <[email protected]>
ananthsub added a commit that referenced this pull request Oct 12, 2026
…undaries

The proof refinement agent runs its own seed, generate, verify, and
correct loop inside a legacy /run, so until now every checkpoint had to
retire its rollouts and restart them from the task input. It now runs
under the agent participant's legacy_run and records a boundary before
seeding, before each generation, before each verification, and once it
has its final result. A restored attempt continues from that boundary:
it skips the seed, keeps the completed attempts, and never regenerates
a proof that was already generated.

- Seeding and generation are replay steps. Verification uses the mode
  the resources server reports on its seed reply.
- The agent's /v1/responses proxy passes the policy model's 409
  admission_closed through to /run instead of failing. /run backs off,
  returns to the boundary before the generation, and parks there once
  the agent's own admission closes.
- The session hooks are no-ops: the boundary holds the whole episode.

math_formal_lean compiles each proof on its own in a stateless sandbox,
so it declares checkpoint_mode = "stateless" and checkpoint_verify =
"replay".

Ported from #3634 onto the v2 checkpoint hooks. The
capture-outcome handling (failing on capture_failed, masking
no_generation), the model-call coordinates, the resource request IDs
and revisions, and the explicit fresh-parent call for correction turns
are not carried: the first two depend on token-capture changes that
are not on this stack, and the rest are gone from the v2 design.

Signed-off-by: Ananth Subramaniam <[email protected]>
ananthsub added a commit that referenced this pull request Oct 13, 2026
…undaries

The proof refinement agent runs its own seed, generate, verify, and
correct loop inside a legacy /run, so until now every checkpoint had to
retire its rollouts and restart them from the task input. It now runs
under the agent participant's legacy_run and records a boundary before
seeding, before each generation, before each verification, and once it
has its final result. A restored attempt continues from that boundary:
it skips the seed, keeps the completed attempts, and never regenerates
a proof that was already generated.

- Seeding and generation are replay steps. Verification uses the mode
  the resources server reports on its seed reply.
- The agent's /v1/responses proxy passes the policy model's 409
  admission_closed through to /run instead of failing. /run backs off,
  returns to the boundary before the generation, and parks there once
  the agent's own admission closes.
- The session hooks are no-ops: the boundary holds the whole episode.

math_formal_lean compiles each proof on its own in a stateless sandbox,
so it declares checkpoint_mode = "stateless" and checkpoint_verify =
"replay".

Ported from #3634 onto the v2 checkpoint hooks. The
capture-outcome handling (failing on capture_failed, masking
no_generation), the model-call coordinates, the resource request IDs
and revisions, and the explicit fresh-parent call for correction turns
are not carried: the first two depend on token-capture changes that
are not on this stack, and the rest are gone from the v2 design.

Signed-off-by: Ananth Subramaniam <[email protected]>
ananthsub added a commit that referenced this pull request Oct 13, 2026
…undaries

The proof refinement agent runs its own seed, generate, verify, and
correct loop inside a legacy /run, so until now every checkpoint had to
retire its rollouts and restart them from the task input. It now runs
under the agent participant's legacy_run and records a boundary before
seeding, before each generation, before each verification, and once it
has its final result. A restored attempt continues from that boundary:
it skips the seed, keeps the completed attempts, and never regenerates
a proof that was already generated.

- Seeding and generation are replay steps. Verification uses the mode
  the resources server reports on its seed reply.
- The agent's /v1/responses proxy passes the policy model's 409
  admission_closed through to /run instead of failing. /run backs off,
  returns to the boundary before the generation, and parks there once
  the agent's own admission closes.
- The session hooks are no-ops: the boundary holds the whole episode.

math_formal_lean compiles each proof on its own in a stateless sandbox,
so it declares checkpoint_mode = "stateless" and checkpoint_verify =
"replay".

Ported from #3634 onto the v2 checkpoint hooks. The
capture-outcome handling (failing on capture_failed, masking
no_generation), the model-call coordinates, the resource request IDs
and revisions, and the explicit fresh-parent call for correction turns
are not carried: the first two depend on token-capture changes that
are not on this stack, and the rest are gone from the v2 design.

Signed-off-by: Ananth Subramaniam <[email protected]>
ananthsub added a commit that referenced this pull request Oct 13, 2026
…undaries

The proof refinement agent runs its own seed, generate, verify, and
correct loop inside a legacy /run, so until now every checkpoint had to
retire its rollouts and restart them from the task input. It now runs
under the agent participant's legacy_run and records a boundary before
seeding, before each generation, before each verification, and once it
has its final result. A restored attempt continues from that boundary:
it skips the seed, keeps the completed attempts, and never regenerates
a proof that was already generated.

- Seeding and generation are replay steps. Verification uses the mode
  the resources server reports on its seed reply.
- The agent's /v1/responses proxy passes the policy model's 409
  admission_closed through to /run instead of failing. /run backs off,
  returns to the boundary before the generation, and parks there once
  the agent's own admission closes.
- The session hooks are no-ops: the boundary holds the whole episode.

math_formal_lean compiles each proof on its own in a stateless sandbox,
so it declares checkpoint_mode = "stateless" and checkpoint_verify =
"replay".

Ported from #3634 onto the v2 checkpoint hooks. The
capture-outcome handling (failing on capture_failed, masking
no_generation), the model-call coordinates, the resource request IDs
and revisions, and the explicit fresh-parent call for correction turns
are not carried: the first two depend on token-capture changes that
are not on this stack, and the rest are gone from the v2 design.

Signed-off-by: Ananth Subramaniam <[email protected]>
ananthsub added a commit that referenced this pull request Oct 13, 2026
…undaries

The proof refinement agent runs its own seed, generate, verify, and
correct loop inside a legacy /run, so until now every checkpoint had to
retire its rollouts and restart them from the task input. It now runs
under the agent participant's legacy_run and records a boundary before
seeding, before each generation, before each verification, and once it
has its final result. A restored attempt continues from that boundary:
it skips the seed, keeps the completed attempts, and never regenerates
a proof that was already generated.

- Seeding and generation are replay steps. Verification uses the mode
  the resources server reports on its seed reply.
- The agent's /v1/responses proxy passes the policy model's 409
  admission_closed through to /run instead of failing. /run backs off,
  returns to the boundary before the generation, and parks there once
  the agent's own admission closes.
- The session hooks are no-ops: the boundary holds the whole episode.

math_formal_lean compiles each proof on its own in a stateless sandbox,
so it declares checkpoint_mode = "stateless" and checkpoint_verify =
"replay".

Ported from #3634 onto the v2 checkpoint hooks. The
capture-outcome handling (failing on capture_failed, masking
no_generation), the model-call coordinates, the resource request IDs
and revisions, and the explicit fresh-parent call for correction turns
are not carried: the first two depend on token-capture changes that
are not on this stack, and the rest are gone from the v2 design.

Signed-off-by: Ananth Subramaniam <[email protected]>
ananthsub added a commit that referenced this pull request Oct 14, 2026
…undaries

The proof refinement agent runs its own seed, generate, verify, and
correct loop inside a legacy /run, so until now every checkpoint had to
retire its rollouts and restart them from the task input. It now runs
under the agent participant's legacy_run and records a boundary before
seeding, before each generation, before each verification, and once it
has its final result. A restored attempt continues from that boundary:
it skips the seed, keeps the completed attempts, and never regenerates
a proof that was already generated.

- Seeding and generation are replay steps. Verification uses the mode
  the resources server reports on its seed reply.
- The agent's /v1/responses proxy passes the policy model's 409
  admission_closed through to /run instead of failing. /run backs off,
  returns to the boundary before the generation, and parks there once
  the agent's own admission closes.
- The session hooks are no-ops: the boundary holds the whole episode.

math_formal_lean compiles each proof on its own in a stateless sandbox,
so it declares checkpoint_mode = "stateless" and checkpoint_verify =
"replay".

Ported from #3634 onto the v2 checkpoint hooks. The
capture-outcome handling (failing on capture_failed, masking
no_generation), the model-call coordinates, the resource request IDs
and revisions, and the explicit fresh-parent call for correction turns
are not carried: the first two depend on token-capture changes that
are not on this stack, and the rest are gone from the v2 design.

Signed-off-by: Ananth Subramaniam <[email protected]>
ananthsub added a commit that referenced this pull request Oct 14, 2026
…undaries

The proof refinement agent runs its own seed, generate, verify, and
correct loop inside a legacy /run, so until now every checkpoint had to
retire its rollouts and restart them from the task input. It now runs
under the agent participant's legacy_run and records a boundary before
seeding, before each generation, before each verification, and once it
has its final result. A restored attempt continues from that boundary:
it skips the seed, keeps the completed attempts, and never regenerates
a proof that was already generated.

- Seeding and generation are replay steps. Verification uses the mode
  the resources server reports on its seed reply.
- The agent's /v1/responses proxy passes the policy model's 409
  admission_closed through to /run instead of failing. /run backs off,
  returns to the boundary before the generation, and parks there once
  the agent's own admission closes.
- The session hooks are no-ops: the boundary holds the whole episode.

math_formal_lean compiles each proof on its own in a stateless sandbox,
so it declares checkpoint_mode = "stateless" and checkpoint_verify =
"replay".

Ported from #3634 onto the v2 checkpoint hooks. The
capture-outcome handling (failing on capture_failed, masking
no_generation), the model-call coordinates, the resource request IDs
and revisions, and the explicit fresh-parent call for correction turns
are not carried: the first two depend on token-capture changes that
are not on this stack, and the rest are gone from the v2 design.

Signed-off-by: Ananth Subramaniam <[email protected]>
ananthsub added a commit that referenced this pull request Oct 14, 2026
…undaries

The proof refinement agent runs its own seed, generate, verify, and
correct loop inside a legacy /run, so until now every checkpoint had to
retire its rollouts and restart them from the task input. It now runs
under the agent participant's legacy_run and records a boundary before
seeding, before each generation, before each verification, and once it
has its final result. A restored attempt continues from that boundary:
it skips the seed, keeps the completed attempts, and never regenerates
a proof that was already generated.

- Seeding and generation are replay steps. Verification uses the mode
  the resources server reports on its seed reply.
- The agent's /v1/responses proxy passes the policy model's 409
  admission_closed through to /run instead of failing. /run backs off,
  returns to the boundary before the generation, and parks there once
  the agent's own admission closes.
- The session hooks are no-ops: the boundary holds the whole episode.

math_formal_lean compiles each proof on its own in a stateless sandbox,
so it declares checkpoint_mode = "stateless" and checkpoint_verify =
"replay".

Ported from #3634 onto the v2 checkpoint hooks. The
capture-outcome handling (failing on capture_failed, masking
no_generation), the model-call coordinates, the resource request IDs
and revisions, and the explicit fresh-parent call for correction turns
are not carried: the first two depend on token-capture changes that
are not on this stack, and the rest are gone from the v2 design.

Signed-off-by: Ananth Subramaniam <[email protected]>
ananthsub added a commit that referenced this pull request Oct 15, 2026
…undaries

The proof refinement agent runs its own seed, generate, verify, and
correct loop inside a legacy /run, so until now every checkpoint had to
retire its rollouts and restart them from the task input. It now runs
under the agent participant's legacy_run and records a boundary before
seeding, before each generation, before each verification, and once it
has its final result. A restored attempt continues from that boundary:
it skips the seed, keeps the completed attempts, and never regenerates
a proof that was already generated.

- Seeding and generation are replay steps. Verification uses the mode
  the resources server reports on its seed reply.
- The agent's /v1/responses proxy passes the policy model's 409
  admission_closed through to /run instead of failing. /run backs off,
  returns to the boundary before the generation, and parks there once
  the agent's own admission closes.
- The session hooks are no-ops: the boundary holds the whole episode.

math_formal_lean compiles each proof on its own in a stateless sandbox,
so it declares checkpoint_mode = "stateless" and checkpoint_verify =
"replay".

Ported from #3634 onto the v2 checkpoint hooks. The
capture-outcome handling (failing on capture_failed, masking
no_generation), the model-call coordinates, the resource request IDs
and revisions, and the explicit fresh-parent call for correction turns
are not carried: the first two depend on token-capture changes that
are not on this stack, and the rest are gone from the v2 design.

Signed-off-by: Ananth Subramaniam <[email protected]>
ananthsub added a commit that referenced this pull request Oct 15, 2026
…undaries

The proof refinement agent runs its own seed, generate, verify, and
correct loop inside a legacy /run, so until now every checkpoint had to
retire its rollouts and restart them from the task input. It now runs
under the agent participant's legacy_run and records a boundary before
seeding, before each generation, before each verification, and once it
has its final result. A restored attempt continues from that boundary:
it skips the seed, keeps the completed attempts, and never regenerates
a proof that was already generated.

- Seeding and generation are replay steps. Verification uses the mode
  the resources server reports on its seed reply.
- The agent's /v1/responses proxy passes the policy model's 409
  admission_closed through to /run instead of failing. /run backs off,
  returns to the boundary before the generation, and parks there once
  the agent's own admission closes.
- The session hooks are no-ops: the boundary holds the whole episode.

math_formal_lean compiles each proof on its own in a stateless sandbox,
so it declares checkpoint_mode = "stateless" and checkpoint_verify =
"replay".

Ported from #3634 onto the v2 checkpoint hooks. The
capture-outcome handling (failing on capture_failed, masking
no_generation), the model-call coordinates, the resource request IDs
and revisions, and the explicit fresh-parent call for correction turns
are not carried: the first two depend on token-capture changes that
are not on this stack, and the rest are gone from the v2 design.

Signed-off-by: Ananth Subramaniam <[email protected]>
ananthsub added a commit that referenced this pull request Oct 15, 2026
…undaries

The proof refinement agent runs its own seed, generate, verify, and
correct loop inside a legacy /run, so until now every checkpoint had to
retire its rollouts and restart them from the task input. It now runs
under the agent participant's legacy_run and records a boundary before
seeding, before each generation, before each verification, and once it
has its final result. A restored attempt continues from that boundary:
it skips the seed, keeps the completed attempts, and never regenerates
a proof that was already generated.

- Seeding and generation are replay steps. Verification uses the mode
  the resources server reports on its seed reply.
- The agent's /v1/responses proxy passes the policy model's 409
  admission_closed through to /run instead of failing. /run backs off,
  returns to the boundary before the generation, and parks there once
  the agent's own admission closes.
- The session hooks are no-ops: the boundary holds the whole episode.

math_formal_lean compiles each proof on its own in a stateless sandbox,
so it declares checkpoint_mode = "stateless" and checkpoint_verify =
"replay".

Ported from #3634 onto the v2 checkpoint hooks. The
capture-outcome handling (failing on capture_failed, masking
no_generation), the model-call coordinates, the resource request IDs
and revisions, and the explicit fresh-parent call for correction turns
are not carried: the first two depend on token-capture changes that
are not on this stack, and the rest are gone from the v2 design.

Signed-off-by: Ananth Subramaniam <[email protected]>
ananthsub added a commit that referenced this pull request Oct 15, 2026
…undaries

The proof refinement agent runs its own seed, generate, verify, and
correct loop inside a legacy /run, so until now every checkpoint had to
retire its rollouts and restart them from the task input. It now runs
under the agent participant's legacy_run and records a boundary before
seeding, before each generation, before each verification, and once it
has its final result. A restored attempt continues from that boundary:
it skips the seed, keeps the completed attempts, and never regenerates
a proof that was already generated.

- Seeding and generation are replay steps. Verification uses the mode
  the resources server reports on its seed reply.
- The agent's /v1/responses proxy passes the policy model's 409
  admission_closed through to /run instead of failing. /run backs off,
  returns to the boundary before the generation, and parks there once
  the agent's own admission closes.
- The session hooks are no-ops: the boundary holds the whole episode.

math_formal_lean compiles each proof on its own in a stateless sandbox,
so it declares checkpoint_mode = "stateless" and checkpoint_verify =
"replay".

Ported from #3634 onto the v2 checkpoint hooks. The
capture-outcome handling (failing on capture_failed, masking
no_generation), the model-call coordinates, the resource request IDs
and revisions, and the explicit fresh-parent call for correction turns
are not carried: the first two depend on token-capture changes that
are not on this stack, and the rest are gone from the v2 design.

Signed-off-by: Ananth Subramaniam <[email protected]>
ananthsub added a commit that referenced this pull request Oct 15, 2026
…undaries

The proof refinement agent runs its own seed, generate, verify, and
correct loop inside a legacy /run, so until now every checkpoint had to
retire its rollouts and restart them from the task input. It now runs
under the agent participant's legacy_run and records a boundary before
seeding, before each generation, before each verification, and once it
has its final result. A restored attempt continues from that boundary:
it skips the seed, keeps the completed attempts, and never regenerates
a proof that was already generated.

- Seeding and generation are replay steps. Verification uses the mode
  the resources server reports on its seed reply.
- The agent's /v1/responses proxy passes the policy model's 409
  admission_closed through to /run instead of failing. /run backs off,
  returns to the boundary before the generation, and parks there once
  the agent's own admission closes.
- The session hooks are no-ops: the boundary holds the whole episode.

math_formal_lean compiles each proof on its own in a stateless sandbox,
so it declares checkpoint_mode = "stateless" and checkpoint_verify =
"replay".

Ported from #3634 onto the v2 checkpoint hooks. The
capture-outcome handling (failing on capture_failed, masking
no_generation), the model-call coordinates, the resource request IDs
and revisions, and the explicit fresh-parent call for correction turns
are not carried: the first two depend on token-capture changes that
are not on this stack, and the rest are gone from the v2 design.

Signed-off-by: Ananth Subramaniam <[email protected]>
ananthsub added a commit that referenced this pull request Oct 16, 2026
…undaries

The proof refinement agent runs its own seed, generate, verify, and
correct loop inside a legacy /run, so until now every checkpoint had to
retire its rollouts and restart them from the task input. It now runs
under the agent participant's legacy_run and records a boundary before
seeding, before each generation, before each verification, and once it
has its final result. A restored attempt continues from that boundary:
it skips the seed, keeps the completed attempts, and never regenerates
a proof that was already generated.

- Seeding and generation are replay steps. Verification uses the mode
  the resources server reports on its seed reply.
- The agent's /v1/responses proxy passes the policy model's 409
  admission_closed through to /run instead of failing. /run backs off,
  returns to the boundary before the generation, and parks there once
  the agent's own admission closes.
- The session hooks are no-ops: the boundary holds the whole episode.

math_formal_lean compiles each proof on its own in a stateless sandbox,
so it declares checkpoint_mode = "stateless" and checkpoint_verify =
"replay".

Ported from #3634 onto the v2 checkpoint hooks. The
capture-outcome handling (failing on capture_failed, masking
no_generation), the model-call coordinates, the resource request IDs
and revisions, and the explicit fresh-parent call for correction turns
are not carried: the first two depend on token-capture changes that
are not on this stack, and the rest are gone from the v2 design.

Signed-off-by: Ananth Subramaniam <[email protected]>
macandro96 pushed a commit that referenced this pull request Oct 16, 2026
…undaries

The proof refinement agent runs its own seed, generate, verify, and
correct loop inside a legacy /run, so until now every checkpoint had to
retire its rollouts and restart them from the task input. It now runs
under the agent participant's legacy_run and records a boundary before
seeding, before each generation, before each verification, and once it
has its final result. A restored attempt continues from that boundary:
it skips the seed, keeps the completed attempts, and never regenerates
a proof that was already generated.

- Seeding and generation are replay steps. Verification uses the mode
  the resources server reports on its seed reply.
- The agent's /v1/responses proxy passes the policy model's 409
  admission_closed through to /run instead of failing. /run backs off,
  returns to the boundary before the generation, and parks there once
  the agent's own admission closes.
- The session hooks are no-ops: the boundary holds the whole episode.

math_formal_lean compiles each proof on its own in a stateless sandbox,
so it declares checkpoint_mode = "stateless" and checkpoint_verify =
"replay".

Ported from #3634 onto the v2 checkpoint hooks. The
capture-outcome handling (failing on capture_failed, masking
no_generation), the model-call coordinates, the resource request IDs
and revisions, and the explicit fresh-parent call for correction turns
are not carried: the first two depend on token-capture changes that
are not on this stack, and the rest are gone from the v2 design.

Signed-off-by: Ananth Subramaniam <[email protected]>
(cherry picked from commit e6bfc0c)
@yaoyu-33
yaoyu-33 marked this pull request as draft November 18, 2026 01:55
@yaoyu-33

Copy link
Copy Markdown
Contributor

We’re doing some cleanup of the open PR list. This PR has had no activity for over a month, so I’ve moved it back to draft.

If this change is still needed, please resolve any merge conflicts and mark the PR ready for review again when it’s ready to merge. Thanks!

@github-actions github-actions Bot removed the sla:triage-overdue Review assignment is over the one-business-day SLA label Nov 18, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:agent Agent harnesses and Responses API agent behavior complexity:medium Single-domain change with interacting parts or a moderate review surface feature New capabilities, enhancements, or enablement work needs-review PR is ready for code review and waiting on a reviewer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants