Skip to content

fix(critpt): score token-limit exhaustion without regeneration - #5383

Merged
cmunley1 merged 2 commits into
mainfrom
codex/critpt-context-exhaustion
Oct 30, 2026
Merged

cmunley1 merged 2 commits into
mainfrom
codex/critpt-context-exhaustion

Conversation

@Kipok

@Kipok Kipok commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

CritPt's custom grader currently marks responses that exhaust max_output_tokens as retryable response_incomplete failures. Resuming evaluation can then generate a replacement answer instead of counting the exhausted attempt.

Score responses with status incomplete, reason max_output_tokens, and no response error as zero with category response_truncated. Preserve the original response and truncation metadata. Other incomplete responses remain retryable. No dataset changes; no separate issue is needed for this focused fix.

Tested the grader suite (1,650 passed, 77 skipped), the additional response-error regression (441 adapter tests passed), pre-commit checks, and verification/resume using an actual model-generated token-limit response: scored zero, response preserved, no pending regeneration. Existing artifacts are not rewritten. New evaluations will count token-limit exhaustion as incorrect rather than regenerate it.

@copy-pr-bot

copy-pr-bot Bot commented Oct 30, 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.

@Kipok
Kipok marked this pull request as ready for review October 30, 2026 20:02
@svcnvidia-nemo-ci svcnvidia-nemo-ci added area:environment Individual environments, benchmarks, verifiers, and environment-specific resources servers bug Something isn't working needs-review PR is ready for code review and waiting on a reviewer labels Oct 30, 2026

@svcnvidia-nemo-ci svcnvidia-nemo-ci left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SHIP WITH CARE

RISK — Add representative model-rollout evidence

Evidence gap: This changes token-limit exhaustion from a retryable failure into a scored zero in verify(), affecting which attempts count toward evaluation results. The supplied validation lists unit tests, pre-commit, and preservation/resume checks, but does not identify a representative real model rollout or inspection of its agent/verifier behavior. The new regression uses a synthetic response and fake grader. AGENTS.md requires real smoke rollouts for behavior-changing environment work; unit tests alone do not satisfy that requirement. This is a validation gap, not a demonstrated runtime defect.

Correction: Could you record a representative run using the shipped pairing and example tasks, including the exact command, model/provider, output-token limit, and inspected results? Include both an actual token-exhausted response and a normally completed control. No implementation rewrite or full fixed-benchmark reward profile is requested.

Acceptance and preservation — proposed checks, not executed here:

  • With a low generation budget, obtain status=incomplete, reason max_output_tokens, and no response error. Confirm reward 0.0, scored=true, mask_sample=false, category response_truncated, unchanged response/truncation metadata, and no _ng_failure_* keys. Resume that output and confirm the same attempt remains counted without another model call.
  • With sufficient budget, confirm a completed answer still follows ordinary source extraction and grading rather than the truncation shortcut.
  • Retain the existing retryability assertions: incomplete without a token-limit reason, completed with incomplete details, response errors, and an incomplete final message in a completed envelope remain unscored and masked. A token-limit envelope carrying a response error must likewise remain retryable. Existing artifacts should remain untouched.

Static inspection covered all three changed files and the directly affected serialization, agent, persistence/resume, and aggregation paths. No implementation defect was found. Tests were not executed in this read-only review.

Review generated by codex. This was a full review. Request a full review with /review reset=true.

@Kipok

Kipok commented Oct 30, 2026

Copy link
Copy Markdown
Contributor Author

We did test this using an actual model-generated response from a real run. The token-limit response was verified as an unmasked, scored zero with its original response and truncation metadata preserved. Resuming from that output left no pending row to regenerate. We also ran the grader tests and added a regression confirming that responses carrying an error remain retryable. We’re keeping the run-specific details private.

@cmunley1

Copy link
Copy Markdown
Contributor

/ok to test b4dd15e

@cmunley1

Copy link
Copy Markdown
Contributor

/review

@svcnvidia-nemo-ci svcnvidia-nemo-ci left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SHIP

LGTM — no concerns found in this follow-up.

The earlier smoke-rollout evidence gap is addressed by the updated description and author reply, reporting a real model-generated token-limit response verified as an unmasked, scored zero, with response/truncation metadata preserved and no regeneration on resume.

Since the previous review, only the response-error regression test changed; the implementation and README are unchanged. The added case checks that token-limit responses carrying an error remain unscored, masked, and retryable. The existing no-error truncation and other incomplete-response cases retain their distinct expectations. Static tracing of classification, serialization, persistence/resume, and aggregation found no introduced regression.

Validation is author-reported: tests and model rollouts were not executed during this read-only review, and private rollout artifacts were not independently inspected.

Review generated by codex. This was a findings-only review. Request a full review with /review reset=true.

osoblanco added a commit to osoblanco/Gym that referenced this pull request Oct 30, 2026
Integrate the fix and error regression coverage from NVIDIA-NeMo#5383:
31b36e3 and
b4dd15e.

Apply the scored-zero outcome to output_text responses and preserve the
agentic finish-tool precedence for infrastructure and invalid evidence.
Add regressions for finish-tool handling and malformed request metadata.

Co-authored-by: Igor Gitman <[email protected]>
Signed-off-by: Igor Gitman <[email protected]>
Signed-off-by: Erik Arakelyan <[email protected]>
@cmunley1
cmunley1 added this pull request to the merge queue Oct 30, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/41139252171

Merged via the queue into main with commit d7fc515 Oct 30, 2026
48 of 51 checks passed
@cmunley1
cmunley1 deleted the codex/critpt-context-exhaustion branch October 30, 2026 23:15
khazic pushed a commit to khazic/Gym-lao that referenced this pull request Nov 18, 2026
…nd opt-in Stirrup overflow recovery (NVIDIA-NeMo#5226)

* feat(critpt): add offline agentic execution and finish submissions

Signed-off-by: Erik Arakelyan <[email protected]>

* docs(critpt): clarify output-budget behavior and parity limits

Signed-off-by: Erik Arakelyan <[email protected]>

* feat(critpt): support sandboxed semantic answer validators

Signed-off-by: Erik Arakelyan <[email protected]>

* fix(critpt): score token-limit exhaustion without regeneration

Integrate the fix and error regression coverage from NVIDIA-NeMo#5383:
31b36e3 and
b4dd15e.

Apply the scored-zero outcome to output_text responses and preserve the
agentic finish-tool precedence for infrastructure and invalid evidence.
Add regressions for finish-tool handling and malformed request metadata.

Co-authored-by: Igor Gitman <[email protected]>
Signed-off-by: Igor Gitman <[email protected]>
Signed-off-by: Erik Arakelyan <[email protected]>

* fix(critpt): fit model budgets and parse mixed code fences

Signed-off-by: Erik Arakelyan <[email protected]>

* fix(stirrup): recover from explicit context-limit rejections

Signed-off-by: Erik Arakelyan <[email protected]>

* fix(stirrup): preserve compaction failures and diagnostics

Signed-off-by: Erik Arakelyan <[email protected]>

* Pass output_dir in the agentic recipe test

Main's NVIDIA-NeMo#5997 makes output_dir a required keyword-only argument of
TrainDataProcessor._collate_samples_single_type. The agentic recipe
test calls it directly, so it now passes tmp_path / "prepared", as
main's own tests do.

Signed-off-by: Erik Arakelyan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Signed-off-by: Erik Arakelyan <[email protected]>
Signed-off-by: Igor Gitman <[email protected]>
Co-authored-by: Igor Gitman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

This branch was previously deployed

1 inactive deployment
public — b4dd15eb Deployed Oct 30, 2026 by copy-pr-bot[bot] via release / finalize / notify #8859
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:environment Individual environments, benchmarks, verifiers, and environment-specific resources servers bug Something isn't working 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.

3 participants