Repository navigation
feat(bird_interact): run BIRD-Interact in its Environment Server, with no Resources Server - #5409
Conversation
|
/ok to test cef7fc5 |
cef7fc5 to
1ba7db8
Compare
|
/ok to test 1ba7db8 |
1ba7db8 to
8ae6ea8
Compare
|
/ok to test 8ae6ea8 |
8ae6ea8 to
0bb3a5e
Compare
|
/ok to test ae31d95 |
|
/ok to test 1fe3440 |
|
/ok to test 2c86204 |
|
/ok to test 7369f39 |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
HOLD
I found grading defects that can change scores, plus protocol and lifecycle failures. This was static review; I did not execute tests or rollouts. I inspected all 20 changed files and their affected runtime and data contracts. One delegated report was unavailable, so I inspected its grading and sandbox topic directly.
RISK: Refresh the real smoke evidence after moving the turn loop. The PR description says the real model runs predate the move of turns into this server. The current episode implementation now seeds, activates and closes agent sessions itself, so the earlier runs do not validate that integration. Could you run and inspect representative current-behavior c-Interact and a-Interact rollouts, including a clarification and a two-phase task? Provide rewards, failed/masked counts, continuation behavior and cleanup observations. Keep the earlier runs identified as historical and retain the scripted regression coverage. Acceptance is real rollout evidence for the current session-driven path, as required by the trusted AGENTS.md quality bar, rather than another scripted-agent test.
NOTE, suggestion: Publish a discoverable benchmark guide. This user-facing benchmark has a server README, but no Fern documentation change. Could you add a focused page and link it from the Environment Server guide? Cover mode selection, a runnable configuration, the ground-truth requirement and the SQLite/custom-test limitations. Keep the README's implementation detail and distinguish the single-phase reward configuration from the default two-phase schedule. Acceptance is a linked page whose commands match the shipped YAML and whose links pass documentation validation.
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.
|
/ok to test 306fc99 |
|
Answers to the two points in the review summary: Current smoke evidence. The session-driven path ran again after the review fixes: All runs on Docker sandboxes, with
Fern page. The recipe now has a row in the Fern environment list (8ca347d6, #5475). A longer page is left for when Lite and Full have real-ground-truth results; until then the server and recipe READMEs hold the runbook. |
|
/ok to test 11d8f53 |
|
/ok to test 4e0f217 |
|
/ok to test 16d306d |
|
/ok to test 3b84adc |
|
This PR should land together with #5478 and #5534, not on its own. Nothing stops it from merging without them today, and at this head three problems that those PRs fix still affect every score:
If this PR needs to land first, those three fixes are small enough to move here. Separately, the replacement sandbox that is never stopped during cleanup is not fixed anywhere in the stack yet (see the comment on The description also needs a few updates:
|
|
/ok to test 2340aac |
|
Agreed: this PR lands together with #5478 and #5534. As on #5473, the stack merges from the top: once #5534 is approved, it merges into #5478's branch, then each PR into its base, so this branch holds #5534's server before it reaches
The replacement sandbox started during cleanup is fixed here, in aa2db189, as you propose. It carries through #5478 and #5534. Description updates:
|
|
/ok to test 3735799 |
|
/ok to test c0deb63 |
…h no Resources Server BIRD-Interact moves into one Environment Server for each mode, as approach A of the BIRD-Interact RFC proposes. The server subclasses BaseEnvironmentServerWithTools directly: its run_episode starts the database sandbox, serves the a-Interact tools, seeds the agent session, runs the turns and grades them. The #5202 prototype splits each episode between an Environment Server and a Resources Server; here the Environment Server owns the database sandbox, the user simulator, the grader, the phase and BIRD-COIN rules and the turns. - The agent session (agent_session.py) is seeded with the episode's grants, resumes across c-Interact turns, and is closed before grading. A turn over turn_timeout_seconds fails the episode for a retry, the optional interaction deadline stops the turns and still grades, and a failure keeps the completed turns, the tool calls and the agent's evidence. - c-Interact: a question or a submission in each agent reply becomes an in-process call. No routes between two servers, and no session cookie that reaches every route. - a-Interact: the nine tools are a TypedToolset of the episode, served over direct HTTP, MCP or both (tool_transports), with the signed episode token, on any of several workers. The first request declares them as strict function tools over direct HTTP, and none over MCP alone. - Each episode starts its database sandbox and registers its stop, so the sandbox stops on every path, including shutdown. A command that fails for infrastructure reasons runs again on a fresh sandbox; then c-Interact fails the episode for a retry and a-Interact masks the sample, as does a simulator failure in an a-Interact ask. - A task without sol_sql, with custom test cases or without its database fails at seed, for good. - The example datasets are declared on the agent, one taskset for each mode, and validated by the Environment Server's task_data.py (the Harbor layout). gym env test's data and catalog checks still cover only Resources Servers (GYMINT-643). grading.py, simulator.py, task_data.py and the example data come from #5202 unchanged, apart from module paths and wording. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Felipe Vieira Frujeri <[email protected]>
…e_sandbox BaseEnvironmentServerWithTools now requires sandbox_provider and starts an episode's sandboxes with start_episode_sandbox, so BIRD-Interact inherits the field and uses the helper. Each sandbox, including a fresh one for a retried command, has its stop registered in the episode's cleanup before it starts. Before, the one cleanup was registered after the first sandbox started, and a stale sandbox whose stop failed was left to the provider's ttl_s. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Felipe Vieira Frujeri <[email protected]>
…ow-up after a budget-spending pass - A request with skip_token_capture keeps its agent turns off the training capture route, as the episode request contract says. - In a-Interact, a passing submission that spends the last coin no longer ends the task: only a submission that did not pass does, so the follow-up stays reachable. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Felipe Vieira Frujeri <[email protected]>
… call times out A TimeoutError before the turn's deadline was re-raised as it was, on the premise that an outer deadline also raises one there. An outer deadline reaches the await as a cancellation, so that error is the call's own, such as aiohttp's socket or connection timeout. Unmapped, it became a terminal unhandled failure that lost the turns and the agent's evidence. It is now the agent's failure, which the episode retries. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Felipe Vieira Frujeri <[email protected]>
…turn bound activation_timeout_seconds - `run` marks the episode as ending before the base class runs its cleanup, and `_replace_sandbox` then refuses. A replacement started during the cleanup would never be stopped, because the cleanup runs its entries in reverse. - `turn_timeout_seconds` becomes `activation_timeout_seconds`, the name `swe_together` uses for the same bound. - The c-Interact example config sets `interaction_timeout_seconds: 3000`, so a slow agent's turns stop and are graded before the episode deadline fails the episode. - The agent timeout goes in `AGENT_TIMEOUT_METADATA_KEY` from `nemo_gym.agents`, not a copy of its string. - Tests: no sandbox is left after a replacement; an ending episode starts no replacement; the two-episode test waits on a barrier, not a fixed sleep. - README: OpenCode, Kilo and OpenClaw accept required MCP grants in their own sandbox; `grading.py` needs Python 3.10; a client error from the user model fails the episode for good; the MCP rule is stated for any harness; no internal tracker key. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Felipe Vieira Frujeri <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Felipe Vieira Frujeri <[email protected]>
|
/ok to test 470b7d0 |
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/45125292268 |
Stacked on #5465 (
simple_agentcontinuation), which is onmain: theBaseEnvironmentServerWithToolsstack (#5346 → #5347 → #5348 → #5349 → #5350 → #5917) has merged. This PR's diff against #5465 isenvironment_servers/bird_interactonly.What changed
BIRD-Interact runs in one Environment Server for each mode, with no Resources Server. This is approach A of the BIRD-Interact RFC; #5202 is the prototype of approach B, which splits each episode between an Environment Server and a Resources Server.
environment_servers/bird_interactsubclassesBaseEnvironmentServerWithTools(#5347) directly, with no user-simulation base class. Itsrunstarts the database sandbox, serves the a-Interact tools, seeds the agent session (agent_session.py), runs the turns and grades them. The server owns the database sandbox, the two-stage user simulator, the grader, the phase and BIRD-COIN rules and the turns. It takessandbox_providerfrom the base class and starts every database sandbox, a fresh one for a retry included, withstart_episode_sandbox(#5917), so the episode's cleanup stops each one.askandsubmit/c_interact/routesTypedToolsetof the episode, over direct HTTP, MCP or bothactivation_timeout_secondsfails the episode for a retry, the optionalinteraction_timeout_secondsstops the turns and still grades, and the agent is closed before grading. A failure keeps the completed turns, the tool calls and the agent's evidence.bird_interact:sandbox_failed), as does a simulator failure in an a-Interactask(bird_interact:user_simulator_failed).direct_httpthe first request declares the nine tools as strict function tools; overmcpalone it declares none, because the agent lists them from the server, and some harnesses refuse a request that also declares tools.task_data.py, the Harbor layout.grading.py,simulator.py,task_data.pyand the example data come from feat(environment): add a user-simulation base class and BIRD-Interact on it #5202 unchanged apart from module paths and wording.data/example_rollouts.jsonlis regenerated from the smoke run below.No public issue: the PRs of the BIRD-Interact stack track the work.
Validation
At this head (2340aac, rebased onto
main5678f14):pytest environment_servers/bird_interact/tests(test_app.pyandtest_agent_session.py, the server's venv)pytest tests/unit_tests -n 16(the CI extras)pytest responses_api_agents/simple_agent/testsuv lock --checkinenvironment_servers/bird_interactpre-commit run --fileson the changed filesThe scripted-agent episode tests run with real database sandboxes on the host (
localprovider). New since the review: no sandbox is left after a replacement; an ending episode starts no replacement sandbox, which fails without the guard; the two-episode test waits on a barrier.Rollout evidence
The table's runs are from before the move of the turns into this server, and they were not rerun on this PR's own head. The session-driven path ran again on 2026-11-17, on the head of the stack, where #5478 has replaced this PR's c-Interact turn loop with the ADK's: the five example tasks in both modes, 10 episodes, 10 completed and none masked (c-Interact mean 0.78, a-Interact 0.82), and no sandbox left running (comment). Docker database sandboxes,
num_workers: 4on each BIRD Environment Server, the five example tasks, two repeats. Policyazure/openai/eccn-gpt-6.1-sol; simulatoropenai/openai/eccn-gpt-6-luna.simple_agentsimple_agentover direct HTTPtool_transports: [mcp])What I checked in the rollouts:
askcontained a task's hidden knowledge entry.bookshop_2) is the known simulator issue the RFC records: the simulator calls a fraction a percentage, so the agent's ×100 answer fails.Compatibility
New server; existing servers do not change. #5202, the approach B prototype, is closed.
Not supported yet:
gym env test's data and catalog checks run only for Resources Servers (gym env test: validate the data and catalog of Environment Servers, as for Resources Servers #6588).test_cases: feat(bird_interact): run BIRD-Interact Lite and Full on PostgreSQL #5473 and feat(bird_interact): grade BIRD-Interact's management tasks by their test cases #5534.model_sampling. The server does not setapplies_model_sampling, so at admission it refuses an episode that carries sampling values, as a NeMo RL training run sends. It is for evaluation until then.Team review fixes (2026-11-19)
A team review found three risks; this PR fixes the one in its own code, 6864560: a
TimeoutErrorbefore a turn's deadline (an aiohttp socket or connection timeout) was re-raised unmapped and became a terminal unhandled failure that lost the turns; it is now the agent's failure, retried (newtests/test_agent_session.py). The SQLite runner's row and preview bounds, and the sandbox replacement holding a query slot, are fixed where that code is final, in #5534; land this PR with the rest of the stack.Review fixes (2026-11-20)
From the second review, in aa2db18 (and 2340aac, which relocks after the rebase onto
main):runnow marks the episode as ending before the base class runs the cleanup, and_replace_sandboxrefuses once it is set.turn_timeout_secondsis nowactivation_timeout_seconds, the nameswe_togetheruses for the same bound.interaction_timeout_seconds: 3000, so a slow agent's turns stop and are graded before the episode deadline.AGENT_TIMEOUT_METADATA_KEYfromnemo_gym.agents.grading.pyneeds Python 3.10; a client error from the user model fails the episode for good; the MCP rule is stated for any harness; no internal tracker key.