Skip to content

fix(agentic-if): AUT-2823 ignore unrelated checkout dirtiness on resume - #5909

Merged
ko3n1g merged 4 commits into
NVIDIA-NeMo:mainfrom
svcnemo-autobot:fix/stable-agentic-if-fingerprint
Nov 10, 2026
Merged

ko3n1g merged 4 commits into
NVIDIA-NeMo:mainfrom
svcnemo-autobot:fix/stable-agentic-if-fingerprint

Conversation

@svcnemo-autobot

@svcnemo-autobot svcnemo-autobot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Background

Generated files can change Gym's dirty suffix or source inventory and reject compatible resumes. Restoring Ether0's hidden checkout reproduced the latter mechanism; CI's historical trigger remains unconfirmed. No separate issue is needed.

What changed

Normalize only the dirty suffix, exclude hidden checkout/cache trees from the component scan, and hash the live judge schema. Keep visible source, revision, dependency and configuration safeguards; leave the global revision helper unchanged.

Details

flowchart LR
  A[Revision without dirty suffix] --> F[Resume fingerprint]
  B[Visible Python and live judge schema] --> F
  C[Dependencies and configuration] --> F
  F --> D[Accept matching journal or reject before dispatch]
Loading

Tests preserve completed-resume artifacts without redispatch and reject source/schema/configuration changes. Older journals with dirty revisions, hidden-source entries or no schema hash need a new run directory; no migration.

Merged requested origin/main at 2514f9b5. The test conflict preserves upstream's dispatch-identity snapshot and restores real identity checks for resume. Authored scope remains three files.

Tested

  • Managed functional:2/8: 3,227 passed, 13 native skips across all 33 assigned components; Agentic IF: 280 passed.
  • Managed unit:lint: all eight applicable hooks passed; guardwords-check excluded by policy; Markdown filename hook had no files.
  • Both rows cover the merged tree committed as 1a0e5629; signing changed no source. Reused the compatible prepared runtime.
  • Native skips remain unvalidated. Other shards/core weren't selected locally; unrelated upstream changes rely on provider CI. Real-model rollout: N/A for resume bookkeeping, with no model/scoring algorithm change.
  • Exact-head GitHub CI remains pending. Previous-head CI failed during Ubuntu package installation before affected tests ran; imported main includes its package-install retry repair.

@copy-pr-bot

copy-pr-bot Bot commented Nov 10, 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.

@svcnvidia-nemo-ci svcnvidia-nemo-ci added area:environment Individual environments, benchmarks, verifiers, and environment-specific resources servers complexity:low Localized change in one scope with a small, straightforward review surface labels Nov 10, 2026
@svcnvidia-nemo-ci

Copy link
Copy Markdown
Contributor

/ok to test 3e35f75

@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

@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 — one RISK: ignoring checkout dirtiness also hides changes to the live judge schema, allowing pending work to resume with different grading semantics.

I reviewed all three changed files and traced the revision producer, journal fingerprint comparison, and judge schema/cache consumers. The inline finding includes a narrow correction and regression checks. This was a static review; I didn't execute tests or verify the reported validation results.

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

@svcnvidia-nemo-ci

Copy link
Copy Markdown
Contributor

/ok to test a71d7f1

@svcnvidia-nemo-ci

Copy link
Copy Markdown
Contributor

/ok to test 0b20272

yaoyu-33
yaoyu-33 previously approved these changes Nov 10, 2026

@yaoyu-33 yaoyu-33 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.

Reviewed the resume identity change and its production callers, with an independent source review. The live judge schema is now fingerprinted, while unrelated dirty-state and hidden generated sources no longer invalidate compatible resumes. Focused test_driver.py regressions passed on Python 3.13.14 (23 passed) against this exact head. CI infrastructure retries remain pending.

@yaoyu-33 yaoyu-33 added the ready-to-merge PR is approved, current, and waiting for final CI or merge label Nov 10, 2026
@yaoyu-33
yaoyu-33 enabled auto-merge November 10, 2026 05:07
@ko3n1g

ko3n1g commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

/resolve-conflict

auto-merge was automatically disabled November 10, 2026 09:05

Head branch was pushed to by a user without write access

@svcnvidia-nemo-ci

Copy link
Copy Markdown
Contributor

/ok to test 1a0e562

@ko3n1g

ko3n1g commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

/review-approve

@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 — the prior RISK is fixed; no eligible new regressions found.

The runtime identity now hashes the live judge schema. A schema-only edit therefore changes the fingerprint, and the journal guard rejects resume before policy or judge dispatch. The pending-resume regression covers the reported counterexample and saved-byte preservation.

I compared the changes since the previous bot review across all three changed files, including hidden-source filtering, restored identity checks on completed resume, and compatibility documentation. I traced the affected schema, fingerprint, and artifact-validation paths. No unresolved prior finding or introduced regression above the historical moderate-impact ceiling remains in this follow-up scope.

This was a static review. I didn't execute tests or independently verify the reported local results or pending CI.

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

@ko3n1g
ko3n1g added this pull request to the merge queue Nov 10, 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/42791333495

Merged via the queue into NVIDIA-NeMo:main with commit ad91093 Nov 10, 2026
69 checks passed
yfw added a commit that referenced this pull request Nov 10, 2026
Resolve the conflicts with #5909, which also skips hidden directories in
runtime_identity() and pins the fingerprint in test_driver.py: take main's
core.py and test_driver.py. The PR's conftest.py pin stays, because it
also covers test_observed_driver.py. README.md keeps both new table rows.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yi-Fu Wu <[email protected]>
yaoyu-33 added a commit that referenced this pull request Nov 10, 2026
Picks up ad91093 (#5909), which stops the agentic_if_realworld resume
tests from failing when the checkout is dirty. CI's server suite hit that
failure at c165acb.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: yaoyu-33 <[email protected]>
yfw added a commit that referenced this pull request Nov 10, 2026
Main's #5909 fixed the cause: the runtime fingerprint skips hidden folders and ignores the checkout's dirty flag. This PR no longer changes agentic_if_realworld.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yi-Fu Wu <[email protected]>
mpatel31415 added a commit to gwarmstrong/Gym that referenced this pull request Nov 10, 2026
Resolve the overlapping AgenticIF fixture change with the main version, where NVIDIA-NeMo#5909 covers the resume identity boundary. Preserve the keepalive, conversion and model option changes while incorporating current main.

Signed-off-by: Martyna Patelka <[email protected]>
khazic pushed a commit to khazic/Gym-lao that referenced this pull request Nov 11, 2026
…n on OpenCode sandbox sessions (NVIDIA-NeMo#5839)

* feat(visual_coding_opencode): visual-coding environment and BabyVision benchmarks on OpenCode sandbox sessions

A multi-turn visual-coding environment: OpenCode answers a question about an image in a sandbox whose shell has
Python with pillow, numpy, scipy and opencv, and a GPT judge grades the final \boxed{} answer against the gold
answer. BabyVision (388 visual-reasoning puzzles) and its question-only variant run on it.

- `resources_servers/visual_coding_opencode`: the judge (`equivalent` scores 1; a failed call or a reply without a
  valid verdict is masked as `judge_failed`, not scored 0), the task-data schema, and a typed seed and close that
  lend each episode a sandbox through `LentSandboxes` with `sandbox_network_access: model_only`, so the sandbox
  reaches only the policy model. A sandbox image (`sandbox_image/Dockerfile`) carries the toolkit and OpenCode
  1.17.11, pinned by its SHA-256.
- The environment config runs each task with `opencode_agent` in a sandbox session behind the
  `single_agent_turn_legacy` Environment Server. The prompt image is attached with `opencode run --file`.
  Compaction is off and there is no step limit, so Gym's token capture joins every model call and the same config
  serves evaluation and RL.
- `benchmarks/babyvision_opencode` and `benchmarks/babyvision_opencode_question_only`: prepare scripts for
  VLMEvalKit's BabyVision TSV (checked by md5), configs and manifests.
- The "Evaluate Visual Coding with OpenCode" tutorial and its index entry.
- Tests: the judge, the lent sandbox and the session contract, the BabyVision configs, the prepare scripts, and the
  example rows run through a seeded `opencode_agent` session.

Based on NVIDIA-NeMo#5712 by Danial MohseniTaheri, moved from a host-CLI agent path onto sandbox sessions.

Co-authored-by: Danial MohseniTaheri <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yi-Fu Wu <[email protected]>

* feat(visual_coding_opencode): five example rows with metrics and rollouts

The server test's data check expects 5 example rows, their metrics and 5 example rollouts.

- example.jsonl: three small synthetic puzzles, and BabyVision tasks 4624 (Spatial Perception, Count 3D blocks) and
  487 (Visual Pattern Recognition, Logic Patterns) from the UnipatAI/BabyVision dataset on Hugging Face (MIT
  license), revision 849cbeea2b1d00ad334e9e1e2b49a1960c9ff3f3, in prepare.py's format. The README names the source.
- example_metrics.json comes from `gym dataset collate ... +mode=example_validation`.
- example_rollouts.jsonl is one rollout of each row: OpenCode in a lent, model-only sandbox, a hosted
  vision-language policy and a gpt-4o-mini judge. Four rows score 1.0; task 4624 ends incomplete and scores 0.

Co-authored-by: Danial MohseniTaheri <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yi-Fu Wu <[email protected]>

* feat(visual_coding_opencode): declare image input in the OpenCode config

The model looks at its crops and plots through OpenCode's read tool, and OpenCode passes those images to the model
only when the model declares image input. Since NVIDIA-NeMo#4922, opencode_agent declares it when the prompt has images or
image_input is true. The prompt image already declared it; image_input: true keeps it declared for any row, as NVIDIA-NeMo#4922
asks of configs whose tools return images. The session tests now run with the setting.

Tests: visual_coding_opencode, BabyVision, docs link and session contract tests: 73 passed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yi-Fu Wu <[email protected]>

* fix(babyvision_opencode): give rows a task_id, license the manifests MIT, and run the prepare tests in CI

- prepare.py writes the TSV index as task_id, which `gym eval plan` needs (it raised ConfigError for every row);
  TaskData declares it, optional, so the example rows stay valid.
- Both manifests say `licensing: MIT`, the license of UnipatAI/BabyVision, so `gym env publish` accepts them.
- The prepare tests move to tests/unit_tests/benchmarks/, where the core test suite runs them; no CI job collected
  benchmarks/babyvision_opencode/tests. A new check covers task_id.
- The README says that mean/reward leaves judge failures out, and that scores are not comparable to the BabyVision
  leaderboard, whose scorer judges only the last \boxed{} with another judge.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yi-Fu Wu <[email protected]>

* fix(visual_coding_opencode): keep the sandbox off every server but the policy model, and grade only a finished final answer

Network and seeds:
- The lent sandbox's egress rule opens every port of the policy model's host, and NeMo RL gives every server
  without its own host that address. The judge, the agent, the resources server and the Environment Server now set
  host 127.0.0.1, so sandbox code cannot spend the judge's key, run OpenCode on the host, or start sandboxes and
  episodes. All their callers run on the same host. A config test checks that only the policy model takes
  NeMo RL's default_host.
- While the server lends sandboxes, it refuses a cookie seed (an agent's own /run, which would run OpenCode on its
  host without the image) and a malformed typed seed with 422; the stateless server refuses only the latter.

Grading:
- A run whose status is incomplete (a timeout, an output cap or a context limit) scores 0 without a judge call, as the
  docs promised; an early \boxed{} guess no longer reaches the judge.
- `extracted` is the last \boxed{}, the answer the prompt asks for, not string_match's last "answer:".
- The verdict comes from every JSON object in the reply that has one: a brace ahead of it no longer masks the row,
  and objects that disagree stay a judge failure. A reply with no choices is a judge failure too.
- Judge calls run inside observe_llm_judge_grading, so judged rows carry a grading record.
- judge_model is removed: the judge's model server picks the model.

Config and docs:
- The Environment Server admits 64 episodes at a time (the agent's concurrency), and an episode has 5400 s, below the
  sandbox's 7200 s TTL; before, all rows started sandboxes at once with a 21600 s deadline.
- The docs say that model_only keeps the model off the internet only on an OpenSandbox server that enforces egress
  at the IP layer (dns+nft), what `thinking` does, and how NeMo RL's masked_reward_policy treats a judge failure.

Tests: verdict parsing, empty choices, incomplete runs, the last \boxed{}, the gold answer in the judge prompt, the
exported verifier fixture, seed refusals, hosts and admission. Ten new cases fail on the old code. 86 passed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yi-Fu Wu <[email protected]>

* feat(visual_coding_opencode): bake OpenCode's plugin dependencies into the sandbox image

opencode_agent always configures a plugin, so OpenCode 1.17.11 installs @opencode-ai/plugin from npm at each start
unless the dependencies are present. The lent sandbox reaches only the model server, so each start waited about 70 s
for that install to fail before the first model call.

The image now builds the dependency archive in two stages, from a copy of benchmarks/agentic_if/opencode's lockfile
with the recipe in benchmarks/agentic_if/README.md: npm ci with Node 24.15.0 (npm 11.12.1), then GNU tar 1.34 and
GNU gzip 1.10 (Debian 11). The build checks the archive against the pinned SHA-256 (77b03eba..., the same bytes
agentic_if pins), and the config sets sandbox_plugin_dependencies_path and _sha256 to it. The docker build context
is sandbox_image/, so the two lockfile files are copied there; a test keeps them equal to agentic_if's.

Checked: the image builds and holds the archive with the pinned digest. Offline (docker --network none), with one
plugin configured and the adapter's OpenCode environment, the first model request came 1.0 s after start with the
archive unpacked into XDG_CONFIG_HOME/opencode, and 71.1 s without it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yi-Fu Wu <[email protected]>

* fix(agentic_if_realworld): skip hidden directories in the runtime source fingerprint

Other test runs in the same checkout install tools into hidden directories
(pi_agent's .pi_node holds node-gyp .py files) and delete them. Hashing them
made the resume fingerprint change mid-test, which failed
test_observed_driver and test_driver in the sharded server suite.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yi-Fu Wu <[email protected]>

* test(agentic_if_realworld): pin the driver's source fingerprint in tests

The driver tests run and then resume within one test. In CI, other
servers' tests share the checkout and add or delete .py files, so the
source hash could change between the run and the resume. The
runtime_identity tests still cover the hash itself.

A conftest fixture pins it for every test in the folder, so the pin
that NVIDIA-NeMo#5088 added inside test_adaptive_capture_selected_parameters_and_resume
is no longer needed. The fixture also covers
test_observed_driver.py::test_http_resume_and_connection_recovery,
which failed the same way.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yi-Fu Wu <[email protected]>

* feat(babyvision_opencode): prepare BabyVision from the public Hugging Face release

prepare.py read BabyVision from one of two VLMEvalKit-style TSVs that have
no public download. It now downloads UnipatAI/BabyVision (MIT license) at
revision 849cbeea2b1d, checks the parquet file's SHA-256 and builds each row
from the release record: the options listed as (A), (B), ... after
"Choices:", the option's letter as the answer, type, subtype and ansType as
category, l2_category and ans_type, and every image as an RGB PNG.
BABYVISION_PARQUET reads a local copy of the file on a host without
internet access.

Both prepared files (babyvision_opencode and the question-only variant) are
byte-identical to the ones the TSV with md5 4216333e produced, so scores on
that copy stay comparable.

Both benchmarks declare prepare_dependencies: [pillow], as agentic_mme
does, since a dev install of Gym has no Pillow.

Signed-off-by: Danial MohseniTaheri <[email protected]>

* fix(visual_coding_opencode): grade only completed runs, count only the judge's own verdict, refuse several workers

- A response whose status is not completed (incomplete, or failed but still sent to verify by the outcome policy) scores 0 without a judge call, so an early \boxed{} guess in a failed run cannot score.
- parse_verdict takes the judge's last verdict object, and the judge prompt marks the model's text as data. A verdict object quoted from the model's text no longer masks the row, so a wrong answer cannot leave the loss by writing one.
- multiple_workers_unsupported_reason refuses num_workers > 1 before launch: lent sandboxes live in one worker's memory.
- Local copies of the response-text and last-\boxed{} helpers replace string_match's private ones. The string_match_reward diagnostic is dropped with them.
- Tests: the judge grading record (completed, failed, none), the close order after a failed stop, a failed run, the worker refusal. The session test moves from opencode_agent's suite into this environment's tests, without the two tests that restated YAML values, and with a text-only row for image_input.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yi-Fu Wu <[email protected]>

* build(visual_coding_opencode): check the OpenCode binary against its pin when the sandbox image builds

The Dockerfile downloads OpenCode 1.17.11 without a build argument and checks the binary against the SHA-256 that the config pins (sandbox_executable_sha256), so a mismatched image fails at build time instead of at the first episode. The config test requires both pins in the Dockerfile.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yi-Fu Wu <[email protected]>

* docs(visual_coding_opencode): head server reach under NeMo RL, tool images in training, OpenCode-only pairing

- Under NeMo RL the lent sandbox can reach Gym's head server, whose /global_config_dict_yaml returns the merged config. The README, tutorial and config comment state this limit.
- The images that read returns are staged by NeMo RL's single controller and recorded by local capture only with NVIDIA-NeMo#5837. Saved rollouts keep only the tool's text.
- The step-limit reason is gone (Gym NVIDIA-NeMo#5833 joins OpenCode's step-limit note under capture). Only the compaction reason stays.
- Only the policy model server advertises the host address. The question-only variant still sends the image. The pairing is OpenCode-only.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yi-Fu Wu <[email protected]>

* test(agentic_if_realworld): drop the driver-test fingerprint pin

Main's NVIDIA-NeMo#5909 fixed the cause: the runtime fingerprint skips hidden folders and ignores the checkout's dirty flag. This PR no longer changes agentic_if_realworld.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yi-Fu Wu <[email protected]>

* data(visual_coding_opencode): regenerate the example rollouts at the head

One OpenCode rollout of each of the 5 example rows, collected at 8a39cda.
All 5 runs complete; 4 are correct, and the 3D cube-counting row answers 20
where 19 is right (judge: different, reward 0). The prompt image is attached
to the first message, so no row reads the old input-media/None path. The rows
carry task_id and no longer carry string_match_reward.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yi-Fu Wu <[email protected]>

* build(visual_coding_opencode): relock for openai 2.45.0

Main's NVIDIA-NeMo#5464 moved the shared openai pin to 2.45.0 and relocked every
component on main. This component was not on main yet, so its lock still had
2.44.0, and both the component-lock check and the server suite's
`uv sync --locked` failed in the merge queue. Regenerated with
scripts/component_locks.py (check_project, update=True); the only change is
openai 2.44.0 -> 2.45.0.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Yi-Fu Wu <[email protected]>

---------

Signed-off-by: Yi-Fu Wu <[email protected]>
Signed-off-by: Yi-Fu Wu <[email protected]>
Signed-off-by: Danial MohseniTaheri <[email protected]>
Co-authored-by: Danial MohseniTaheri <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

This branch was previously deployed

1 inactive deployment
public — 1a0e5629 Deployed Nov 10, 2026 by copy-pr-bot[bot] via release / finalize / notify #11376
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 complexity:low Localized change in one scope with a small, straightforward review surface ready-to-merge PR is approved, current, and waiting for final CI or merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants