Repository navigation
feat(visual_coding_opencode): visual-coding environment and BabyVision on OpenCode sandbox sessions - #5839
Conversation
|
/ok to test 75fe2bc |
|
/ok to test 1a81487 |
|
/ok to test 5a53776 |
@yfw, there was an error processing your request: See the following link for more information: https://docs.gha-runners.nvidia.com/cpr/e/2/ |
@yfw, there was an error processing your request: See the following link for more information: https://docs.gha-runners.nvidia.com/cpr/e/2/ |
728cae8 to
1686209
Compare
5a53776 to
500a95c
Compare
|
/ok to test 500a95c |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
HOLD
The sandbox can reach the credential-backed judge, which violates the intended policy-only boundary. I also found four reliability defects and two documentation issues, detailed inline.
I assessed all 34 changed files and their directly affected contracts. I covered grading and data/docs directly where delegated reports weren't available. This was static review: I didn't run tests, build the image, decode the example images, or reproduce the reported evaluation and RL smokes.
Note: formal approval is not available for this request, so this review is posted as a comment only.
Review generated by codex. This was a full review. Request a full review with /review reset=true.
1686209 to
f97a6ac
Compare
500a95c to
9af1da9
Compare
|
/ok to test 9af1da9 |
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/42889337955 |
Main 5365700. One conflict, in the README environment table: main's #5819 renamed the second Vibench row to vibench_legacy_agent.yaml. Kept main's rows and this PR's Visual Coding Opencode row; scripts/update_env_list.py gives the same table. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Yi-Fu Wu <[email protected]>
|
/ok to test e1ee213 |
…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]>
|
/ok to test 8c39ca8 |
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/42927370561 |
Main 7bceb31. No conflicts. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Yi-Fu Wu <[email protected]>
Main's #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]>
|
/ok to test 5919a29 |
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/42936681191 |
What this is
A multi-turn visual-coding environment,
visual_coding_opencode, with the BabyVision benchmark (388 visual-reasoning puzzles) and its question-only variant. OpenCode answers a question about an image in a sandbox whose shell has Python with pillow, numpy, scipy and opencv, so the model can crop, measure and plot the image. A GPT judge grades the final\boxed{}answer against the gold answer.Each task runs as an
opencode_agentsandbox session behind thesingle_agent_turn_legacyEnvironment Server:LentSandboxes, withsandbox_network_access: model_only: the sandbox reaches only the policy model server's host, on every port, so the model cannot look answers up (blocking raw IPs needs an OpenSandbox server withdns+nft). Every other Gym server in this config (the judge, the agent, the resources and Environment Servers) sets host127.0.0.1, so sandbox code cannot reach them, also under NeMo RL'sdefault_host. One limit: under NeMo RL, Gym's head server takes the node address, which is the policy host, so the sandbox can reach it and its/global_config_dict_yaml(the merged config, including any key passed literally). Other environments' servers in an RL blend that do not set127.0.0.1get the node address too. Allowing only the model server's port needs a change in core. The close stops the sandbox. The sandbox image carries the toolkit, OpenCode 1.17.11 and OpenCode's plugin dependencies, each pinned by SHA-256 and checked when the image builds.opencode run --file, and the agent setsimage_input: true, so OpenCode's read tool also returns the model's crops and plots as images. Compaction is off, so Gym's token capture joins every model call, and the same config serves evaluation and RL training. There is no step limit.\boxed{}and the end of the model's text. Only the judge's own verdict, the last one in its reply, counts, and the judge prompt marks the model's text as data. A run that does not complete scores 0 without a judge call: anincompleterun (a timeout, an output cap or a context limit), or afailedrun that the outcome policy still sends to verify. A judge failure (a failed call, or a reply without a valid verdict) is masked asjudge_failed, not scored 0.num_workers > 1before launch, because lent sandboxes live in one worker's memory.The PR also adds the "Evaluate Visual Coding with OpenCode" tutorial, the BabyVision prepare scripts, and five example rows with their metrics and rollouts.
prepare.pydownloads the publicUnipatAI/BabyVisionrelease (MIT license) at a pinned revision and checks its SHA-256; that commit is Danial's from #5915. Two of the example rows are BabyVision tasks from the same release.Issue
No linked issue: this continues #5712 and #5814 (below).
Relation to other PRs
LentSandboxeswith the model-only network option, session limits inopencode_agent) and on feat: binary sandbox files and shared media helpers #4917 and feat(opencode): attach prompt images in agent sessions #4922 (prompt images in agent sessions). All three are on main, and the branch has main as of 11-10. It adds no copies of their helpers./ng-rollout/<id>/route, sotoken_id_captureand model-call observability see every call, and main's builder masks a broken call chain instead of training on part of it. The images thatreadreturns come between model calls: NeMo RL's single controller stages them (the RL smoke below ran that way), and feat(token-capture): record sampler top-k and tool images in local ca… #5837 adds them to local capture. Saved rollouts keep the prompt image, but only the text ofread's tool outputs.Compatibility and benchmark impact
A new environment and two new benchmarks. No existing config, benchmark or result changes, and no file outside this environment changes. An earlier version of this PR changed
agentic_if_realworld's resume fingerprint; main's #5909 fixed that cause, so the PR no longer touches that folder. There is no full 388-row baseline yet.Validation
opencode_agentsession, verifier fixture),opencode_agent(904, 23 skipped), and the unit tests for the BabyVision configs and prepare, docs links, the public API and the README table (1020) pass. pre-commit passes. CI passed at 8a39cda; after it, the branch adds only the merge with main and the regenerated example rollouts.gym env test +entrypoint=resources_servers/visual_coding_opencode +should_validate_data=true: the data validates.Earlier runs, before the review fixes of 11-10:
All 128 rollouts of each step were graded, every training row carried its images, and the generation KL error stayed near 0.004. No sandbox stop failed. A few sandboxes went away mid-episode (HTTP 410 to the agent); no rollout was dropped for it.
🤖 Generated with Claude Code