Repository navigation
refactor(tb4): move rollout ownership to the agent server - #3573
Merged
Merged
Conversation
Seed task sandboxes through the resources server, execute mini-SWE in the agent, and submit agent results to resource-owned verification and cleanup. Signed-off-by: Frederic Lafrance <[email protected]>
Pass the Responses output-limit reason to mini-SWE so its native concise-response reminder reaches the next model turn after a missing or malformed tool call. Signed-off-by: Frederic Lafrance <[email protected]>
Signed-off-by: Frederic Lafrance <[email protected]>
Signed-off-by: Frederic Lafrance <[email protected]>
Contributor
Author
|
/ok to test 7644576 |
bxyu-nvidia
requested changes
Sep 21, 2026
Signed-off-by: Frederic Lafrance <[email protected]>
bxyu-nvidia
approved these changes
Sep 22, 2026
Contributor
|
/ok to test 50bd3c2 |
7 tasks done
cmunley1
pushed a commit
to osoblanco/Gym
that referenced
this pull request
Oct 19, 2026
## What does this PR do? TB4 currently reports an infrastructure outcome when an executing agent's sandbox dies after exceeding its allocation, so the rollout is omitted from scoring. Record a completed zero grade for provider-confirmed memory or ephemeral-storage limit deaths, preserving diagnostics, cleanup and verification replay. Keep setup, verifier, node-pressure and ambiguous failures as infrastructure outcomes. The rollout and trial result expose `sandbox_resource_limit`; `verifier_result.source` identifies the limit-based grade. A dead agent sandbox skips the separate verifier, with null test counts. Pin the mini-SWE host dependency to LiteLLM 1.102.1 for Gym's MCP 1 runtime. Newer LiteLLM releases import MCP 2 response types before dispatching model calls, breaking fresh installs. Follow-up to NVIDIA-NeMo#3573; no separate issue is needed for this scoped grading correction. ## Validation - `pre-commit run --all-files` passes without modifying files. - TB4 example-data validation passes. - Regression coverage checks execution, quiescing, artifact collection, teardown, cleanup and restart replay. The storage-death regression fails on the base implementation because `evaluation_completed` remains false. ## Rollouts Bounded real-model smoke with `gpt-5.4-mini-2026-03-17`: - Control: one bash call, artifact collection and a separate verifier, reward **1.0**. - Limit failure: one bash call writes at most 2 GiB in a 1 GiB sandbox; OpenSandbox confirms storage-limit eviction, yielding completed reward **0.0** without launching a verifier. - Native aggregation retains both outcomes: **2/2 scored, mean reward 0.5**. Both sessions close, and the sandbox API confirms no owned test sandboxes remain. ## Compatibility and benchmark impact Applies automatically to new TB4 evaluations. Confirmed agent resource-limit deaths now contribute zero to the pass-rate denominator. Existing completed session records replay their saved results unchanged; provider details and the original agent termination remain available. ## Checklist - [x] I have read the contributing guidelines. - [x] The change is focused. - [x] Tests added or updated and pass locally. - [x] Documentation updated. - [x] Pre-commit checks pass locally (`pre-commit run --all-files`). - [x] New source files include the required Apache-2.0 SPDX header. - [x] All commits have DCO sign-off. --------- Signed-off-by: Frederic Lafrance <[email protected]>
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow up on #3366 to match Gym's agent/resources server pattern: the mini-SWE agent owns setup, model calls, and the rollout loop; TB4 resources provisions
/seed_sessionand grades and cleans up through/verify./verifyatomically transfers ownership to the verifier lifecycle, so the seed deadline cannot interrupt grading. Configure the deadline withseeded_session_timeout_secortb4_seeded_session_timeout_sec.shutdown_timeout_secbudget for completing seeding and requesting cleanup. If the seed response remains blocked, shutdown returns and resource-side expiry provides the cleanup fallback.The split preserves retry deduplication, session ownership, model-call capture, and official grading after agent timeout/failure. Existing top-level TB4 overrides remain supported. Direct
model_server,harness, and agent-timeout overrides move to the agent configuration. Agent trajectories remain insidetb4_jobs_dirwhen configured, withtb4_agent_artifacts_diravailable for an explicit override. Persisted session records advance to version 3. Changes are confined to TB4 and its mini-SWE adapter.Real smoke:
gpt-5.4-mini-2026-03-17,interleaved-vigenere, two model turns, 180-second agent cap. Both model calls returned HTTP 200; official grading completed with reward 0 after the step cap, and all resources were cleaned up. A separate real sandbox seeded with a two-second deadline expired without grading, cleaned up its resources, and released its concurrency slot. An earlierhtml-js-filtersmoke completed its agent turns but its browser verifier stalled and was stopped; it is not counted as a completed end-to-end smoke.