Repository navigation
Conversation
… on it Add BaseUserSimulationEnvironmentServer to nemo_gym. It owns the agent session, the turn loop, the turn and interaction deadlines, and the failure stages for Environment Servers that write every user message. A subclass implements start_episode, agent_access, opening_request, next_user_turn and finish_episode. simple_agent now supports resume_harness_session continuation: it keeps the session's conversation and gets only the new input on each activation, so multi-turn episodes can run on it. Add BIRD-Interact as the first subclass, in both modes. The bird_interact Resources Server holds each episode's SQLite copy, the two-stage user simulator, the grader and the BIRD-COIN budget. c-Interact calls its /ask and /submit routes; a-Interact grants the agent the same actions as tools under /a_interact/. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Felipe Vieira Frujeri <[email protected]>
The bird_interact Resources Server now starts a sandbox for each session at seed and stops it at close, and at shutdown stops any sandbox still open. The episode database, the agent's SQL (a-Interact execute) and grading run there through grading.py, which the server uploads with the database source and runs as `python3 grading.py <setup|execute|grade> <request.json>`. Requests go in an uploaded file, not on the command line. A command the sandbox does not run is an infrastructure failure: it runs again on a fresh sandbox up to inconclusive_verification_retries times, then the route answers 503. In c-Interact the Environment Server retries the episode; in a-Interact verify masks the sample with bird_interact:sandbox_failed. A failed close keeps the session so the next close retries the stop. The config binds `sandbox_provider: sandbox` (pick a provider config with --config); tests use the local provider. The README's run instructions now show the materialized taskset input that gym eval run needs. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Felipe Vieira Frujeri <[email protected]>
The Resources Server starts the session sandboxes, so its venv needs the provider SDKs. Without nemo-gym[sandbox], an OpenSandbox provider fails every seed with "tenacity is required for OpenSandbox retry handling". Matches the other sandboxed Resources Servers, such as swebench_pro and gdpval. The Environment Server does not use sandboxes and is unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Felipe Vieira Frujeri <[email protected]>
… check the mode The c-Interact routes, /ask and /submit, did not check the session's mode. An a-Interact agent could reach them with a tool name such as ../submit: simple_agent does not check tool names, and the URL resolves outside the /a_interact/ prefix. /submit then graded the SQL without charging its BIRD-COIN. - Move the routes to /c_interact/ask and /c_interact/submit, next to /a_interact/. - Refuse an a-Interact session on them with 409, as the a-Interact tools already refuse a c-Interact session. - Test that both routes refuse an a-Interact session and grade nothing. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Felipe Vieira Frujeri <[email protected]>
The Environment Server read the opening request's context from a route of its own, /episode_context, because the seed reply had no room for it. In a-Interact that route also returned the schema, the column meanings and the knowledge base, which the tools charge BIRD-COIN for. - The seed reply is now BirdInteractSeedSessionResponse, a subclass of ResourcesSeedSessionResponse with the episode's context, and /episode_context is gone. - In a-Interact the context has only the database, the request and the coin budget. - check_resources_session_contract takes a keyword-only seed_response_model, for a server whose seed reply adds typed fields. The default still forbids extra fields. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Felipe Vieira Frujeri <[email protected]>
Every Resources Server must ship a task_data.py that describes its dataset rows, and bird_interact did not, so tests/unit_tests/test_task_data.py failed. - Move BirdInteractTask and its parts from schemas.py to task_data.py, which may import only the standard library and Pydantic, and export it as TaskData. The importers now read it from task_data. - Declare the published row fields that Gym does not read (category, high_level, external_knowledge, clean_up_sqls) as provenance, so the example rows validate. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Felipe Vieira Frujeri <[email protected]>
…reate_params The hook returns the first turn's request, which is the object Gym calls responses_create_params everywhere else: a dataset row's field, the field of BaseVerifyRequest, and what single_agent_turn sends to the agent. BIRD already passed it to /verify under that name. Rename the hook, its call in the base class, BIRD's implementation and episode field, and the base-class test, and say in the docstring that later turns send only a UserMessage. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Felipe Vieira Frujeri <[email protected]>
Codex, Pi and Hermes accept only MCP tool grants, so none of them could run a-Interact. - The Resources Server serves the nine tools at its root, Gym's convention, and over MCP (`expose_tools_over_mcp: true` in the config). MCP auto-exposure refuses a tool name with a slash, so the `/a_interact/` prefix goes. - `mcp_tools()` leaves out the `/c_interact/` routes. A session's MCP token lists the nine tools in a-Interact and none in c-Interact. - The tools' descriptions and arguments live in `schemas.A_INTERACT_TOOLS`, so the agent sees the same tools over either transport. - The Environment Server takes `resources_tool_transports`, as single_agent_turn does: `direct_http` (the default), `mcp`, or both. Over MCP alone the first request declares no tools, because Codex refuses one that does. `mcp` without exposure on the Resources Server fails at seed, for good. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Felipe Vieira Frujeri <[email protected]>
…ssage A harness with its own tools, such as a shell, can take several steps in one c-Interact turn and write a message at each. `output_text` joined them all, so SQL drafted in an early step became a submission, and a question carried the narration of every step. The reply is now the last message, the one that answers the user. For a one-step turn, as with simple_agent, nothing changes. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Felipe Vieira Frujeri <[email protected]>
The Resources Server uploads each sandbox command's request as a JSON file, and a grade request holds the solution SQL. Nothing deleted the files, so every graded submission left its solution in the session sandbox. The agent never gets that sandbox today, so nothing leaked, but the sandbox would expose the answers if it were ever granted. grading.py now deletes the request file once it has read it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Felipe Vieira Frujeri <[email protected]>
The Environment Server README gets a table of the main harnesses (simple_agent, Codex, Pi, Hermes, Stirrup, OpenCode, Claude Code, Kilo, OpenClaw) and what each adapter's session seed accepts in each mode. It says the rows come from the seed checks, not from runs. The gaps it records are in the adapters: multi-turn sessions for c-Interact and tool grants for a-Interact. It also explains why neither mode grants a sandbox, and the reachability an MCP grant needs from a sandboxed harness. The Resources Server's verify docstring says it grades from session state and does not read the request's response. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Felipe Vieira Frujeri <[email protected]>
Signed-off-by: Felipe Vieira Frujeri <[email protected]>
Signed-off-by: Felipe Vieira Frujeri <[email protected]>
The example's request read "For each author, show their name and how many of their books are bestsellers", but its ground truth lists only the authors with at least one bestseller, as its unambiguous `query` says. An agent that listed every author with a count of 0 gave a fair reading and failed, which tested the wording, not the hidden Bestseller definition. The request now asks for the authors who have bestsellers. The term "bestsellers" stays, so the hidden-knowledge ambiguity is unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Felipe Vieira Frujeri <[email protected]>
…ones `gym env test` checks five example rows for a resources server; BIRD had three, each with one critical ambiguity. Most published BIRD-Interact tasks have two or more, of several types. - bookshop_4: "earned" (linked to the Revenue entry, hidden here) and "last quarter" (semantic), ranked, with a follow-up that depends on phase 1's result. - bookshop_5: "big markdowns" (semantic) and "how much was knocked off" (intent), with no hidden knowledge. Each solution passes grading.py against itself, and plausible misreadings of each ambiguity fail. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Felipe Vieira Frujeri <[email protected]>
CI's changed-server step runs the example data check, which needs example_metrics.json and five example rollouts. BIRD had neither. - The two example datasets now share the name `example`. They declare one file under two tasksets; the metrics sidecar leaves out the taskset but keeps the name, so two names conflicted. - example_rollouts.jsonl has one c-Interact rollout for each task, with simple_agent. The check expects one rollout for each row, so the a-Interact rollouts are left out. - bookshop_4 asks for the top country first instead of a ranking: in the first run, the agent added a RANK() column in both modes, which no ambiguity covers. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Felipe Vieira Frujeri <[email protected]>
The data check wanted exactly five rows in example_rollouts.jsonl. A benchmark that runs the same examples under two Environment Servers, such as BIRD-Interact's two modes, routes each run by its own taskset and so has five rollouts per taskset. Count the rollouts by the taskset in their task ID; rollouts without one (and the placeholder rows some servers commit) count as one group, so every other server's check is unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Felipe Vieira Frujeri <[email protected]>
The examples run in both modes, under one taskset each, so the example rollouts now hold both: the five c-Interact rollouts, then the five a-Interact ones from the same run (W&B ix06ycxw). 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]>
Contributor
Author
|
/ok to test c71b12c |
Contributor
ffrujeri
added a commit
that referenced
this pull request
Nov 12, 2026
A user-simulation Environment Server activates the agent once for each turn of the conversation and sends only the new user message. Simple Agent now accepts a seed that asks for continuation: each activation runs the turn loop on the session's conversation plus its new input, and keeps the first activation's tools and instructions. - An activation without new input, or one that replaces the session's tools or instructions, gets 422. - A retried activation gets its reply without another model call. - The close returns the trajectory of every activation. - A continuation seed is refused when partial-rollout checkpoints are on, because a checkpoint exports no conversation history. Carried over from #5202, which prototyped it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Felipe Vieira Frujeri <[email protected]>
ffrujeri
added a commit
that referenced
this pull request
Nov 12, 2026
…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]>
ffrujeri
added a commit
that referenced
this pull request
Nov 12, 2026
A user-simulation Environment Server activates the agent once for each turn of the conversation and sends only the new user message. Simple Agent now accepts a seed that asks for continuation: each activation runs the turn loop on the session's conversation plus its new input, and keeps the first activation's tools and instructions. - An activation without new input, or one that replaces the session's tools or instructions, gets 422. - A retried activation gets its reply without another model call. - The close returns the trajectory of every activation. - A continuation seed is refused when partial-rollout checkpoints are on, because a checkpoint exports no conversation history. Carried over from #5202, which prototyped it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Felipe Vieira Frujeri <[email protected]>
ffrujeri
added a commit
that referenced
this pull request
Nov 12, 2026
…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]>
ffrujeri
added a commit
that referenced
this pull request
Nov 12, 2026
A user-simulation Environment Server activates the agent once for each turn of the conversation and sends only the new user message. Simple Agent now accepts a seed that asks for continuation: each activation runs the turn loop on the session's conversation plus its new input, and keeps the first activation's tools and instructions. - An activation without new input, or one that replaces the session's tools or instructions, gets 422. - A retried activation gets its reply without another model call. - The close returns the trajectory of every activation. - A continuation seed is refused when partial-rollout checkpoints are on, because a checkpoint exports no conversation history. Carried over from #5202, which prototyped it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Felipe Vieira Frujeri <[email protected]>
ffrujeri
added a commit
that referenced
this pull request
Nov 12, 2026
…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]>
ffrujeri
added a commit
that referenced
this pull request
Nov 13, 2026
A user-simulation Environment Server activates the agent once for each turn of the conversation and sends only the new user message. Simple Agent now accepts a seed that asks for continuation: each activation runs the turn loop on the session's conversation plus its new input, and keeps the first activation's tools and instructions. - An activation without new input, or one that replaces the session's tools or instructions, gets 422. - A retried activation gets its reply without another model call. - The close returns the trajectory of every activation. - A continuation seed is refused when partial-rollout checkpoints are on, because a checkpoint exports no conversation history. Carried over from #5202, which prototyped it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Felipe Vieira Frujeri <[email protected]>
ffrujeri
added a commit
that referenced
this pull request
Nov 13, 2026
…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]>
ffrujeri
added a commit
that referenced
this pull request
Nov 16, 2026
A user-simulation Environment Server activates the agent once for each turn of the conversation and sends only the new user message. Simple Agent now accepts a seed that asks for continuation: each activation runs the turn loop on the session's conversation plus its new input, and keeps the first activation's tools and instructions. - An activation without new input, or one that replaces the session's tools or instructions, gets 422. - A retried activation gets its reply without another model call. - The close returns the trajectory of every activation. - A continuation seed is refused when partial-rollout checkpoints are on, because a checkpoint exports no conversation history. Carried over from #5202, which prototyped it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Felipe Vieira Frujeri <[email protected]>
ffrujeri
added a commit
that referenced
this pull request
Nov 16, 2026
…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]>
ffrujeri
added a commit
that referenced
this pull request
Nov 16, 2026
A user-simulation Environment Server activates the agent once for each turn of the conversation and sends only the new user message. Simple Agent now accepts a seed that asks for continuation: each activation runs the turn loop on the session's conversation plus its new input, and keeps the first activation's tools and instructions. - An activation without new input, or one that replaces the session's tools or instructions, gets 422. - A retried activation gets its reply without another model call. - The close returns the trajectory of every activation. - A continuation seed is refused when partial-rollout checkpoints are on, because a checkpoint exports no conversation history. Carried over from #5202, which prototyped it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Felipe Vieira Frujeri <[email protected]>
ffrujeri
added a commit
that referenced
this pull request
Nov 16, 2026
…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]>
ffrujeri
added a commit
that referenced
this pull request
Nov 16, 2026
A user-simulation Environment Server activates the agent once for each turn of the conversation and sends only the new user message. Simple Agent now accepts a seed that asks for continuation: each activation runs the turn loop on the session's conversation plus its new input, and keeps the first activation's tools and instructions. - An activation without new input, or one that replaces the session's tools or instructions, gets 422. - A retried activation gets its reply without another model call. - The close returns the trajectory of every activation. - A continuation seed is refused when partial-rollout checkpoints are on, because a checkpoint exports no conversation history. Carried over from #5202, which prototyped it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Felipe Vieira Frujeri <[email protected]>
ffrujeri
added a commit
that referenced
this pull request
Nov 16, 2026
…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]>
ffrujeri
added a commit
that referenced
this pull request
Nov 16, 2026
…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]>
ffrujeri
added a commit
that referenced
this pull request
Nov 17, 2026
A user-simulation Environment Server activates the agent once for each turn of the conversation and sends only the new user message. Simple Agent now accepts a seed that asks for continuation: each activation runs the turn loop on the session's conversation plus its new input, and keeps the first activation's tools and instructions. - An activation without new input, or one that replaces the session's tools or instructions, gets 422. - A retried activation gets its reply without another model call. - The close returns the trajectory of every activation. - A continuation seed is refused when partial-rollout checkpoints are on, because a checkpoint exports no conversation history. Carried over from #5202, which prototyped it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Felipe Vieira Frujeri <[email protected]>
ffrujeri
added a commit
that referenced
this pull request
Nov 17, 2026
…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]>
ffrujeri
added a commit
that referenced
this pull request
Nov 18, 2026
A user-simulation Environment Server activates the agent once for each turn of the conversation and sends only the new user message. Simple Agent now accepts a seed that asks for continuation: each activation runs the turn loop on the session's conversation plus its new input, and keeps the first activation's tools and instructions. - An activation without new input, or one that replaces the session's tools or instructions, gets 422. - A retried activation gets its reply without another model call. - The close returns the trajectory of every activation. - A continuation seed is refused when partial-rollout checkpoints are on, because a checkpoint exports no conversation history. Carried over from #5202, which prototyped it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Felipe Vieira Frujeri <[email protected]>
ffrujeri
added a commit
that referenced
this pull request
Nov 18, 2026
…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]>
ffrujeri
added a commit
that referenced
this pull request
Nov 19, 2026
…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]>
ffrujeri
added a commit
that referenced
this pull request
Nov 19, 2026
A user-simulation Environment Server activates the agent once for each turn of the conversation and sends only the new user message. Simple Agent now accepts a seed that asks for continuation: each activation runs the turn loop on the session's conversation plus its new input, and keeps the first activation's tools and instructions. - An activation without new input, or one that replaces the session's tools or instructions, gets 422. - A retried activation gets its reply without another model call. - The close returns the trajectory of every activation. - A continuation seed is refused when partial-rollout checkpoints are on, because a checkpoint exports no conversation history. Carried over from #5202, which prototyped it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Felipe Vieira Frujeri <[email protected]>
ffrujeri
added a commit
that referenced
this pull request
Nov 19, 2026
…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]>
ffrujeri
added a commit
that referenced
this pull request
Nov 20, 2026
A user-simulation Environment Server activates the agent once for each turn of the conversation and sends only the new user message. Simple Agent now accepts a seed that asks for continuation: each activation runs the turn loop on the session's conversation plus its new input, and keeps the first activation's tools and instructions. - An activation without new input, or one that replaces the session's tools or instructions, gets 422. - A retried activation gets its reply without another model call. - The close returns the trajectory of every activation. - A continuation seed is refused when partial-rollout checkpoints are on, because a checkpoint exports no conversation history. Carried over from #5202, which prototyped it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Felipe Vieira Frujeri <[email protected]>
ffrujeri
added a commit
that referenced
this pull request
Nov 20, 2026
…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]>
ffrujeri
added a commit
that referenced
this pull request
Nov 21, 2026
…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]>
ffrujeri
added a commit
that referenced
this pull request
Nov 21, 2026
…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]>
ffrujeri
added a commit
that referenced
this pull request
Nov 23, 2026
A user-simulation Environment Server activates the agent once for each turn of the conversation and sends only the new user message. Simple Agent now accepts a seed that asks for continuation: each activation runs the turn loop on the session's conversation plus its new input, and keeps the first activation's tools and instructions. - An activation without new input, or one that replaces the session's tools or instructions, gets 422. - A retried activation gets its reply without another model call. - The close returns the trajectory of every activation. - A continuation seed is refused when partial-rollout checkpoints are on, because a checkpoint exports no conversation history. Carried over from #5202, which prototyped it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Felipe Vieira Frujeri <[email protected]>
ffrujeri
added a commit
that referenced
this pull request
Nov 23, 2026
…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]>
MichielMAnalytics
pushed a commit
to MichielMAnalytics/Gym
that referenced
this pull request
Nov 23, 2026
…DIA-NeMo#5465) * feat(simple_agent): continue an agent session across activations A user-simulation Environment Server activates the agent once for each turn of the conversation and sends only the new user message. Simple Agent now accepts a seed that asks for continuation: each activation runs the turn loop on the session's conversation plus its new input, and keeps the first activation's tools and instructions. - An activation without new input, or one that replaces the session's tools or instructions, gets 422. - A retried activation gets its reply without another model call. - The close returns the trajectory of every activation. - A continuation seed is refused when partial-rollout checkpoints are on, because a checkpoint exports no conversation history. Carried over from NVIDIA-NeMo#5202, which prototyped it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Felipe Vieira Frujeri <[email protected]> * fix(simple_agent): make continuation sessions checkpoint-safe, observable and explicit Review fixes for simple_agent's continuation sessions: - Checkpointing: a continuation seed is accepted, and its reply carries CHECKPOINT_RESTART_HEADER, because a checkpoint does not export the conversation; the episode starts over after a restore. A session restored without its conversation refuses its next activation (409). - Opt-in: only a class that sets continuation_supported in its own body supports continuation, so DeepAgentsAgent, which replaces responses(), refuses a continuation seed again. - Settings: a later activation that changes any setting of the first (tool_choice, temperature, ...), not only tools or instructions, gets 422 instead of having it silently dropped. - Observations: a continuation session always collects the trajectory and timing its seed confirms, also without observability_enabled. A failed or cancelled activation adds a failed or incomplete invocation and an agent_activation_interrupted gap before it re-raises. Turns carry their activation_id. Each invocation keeps only its activation's new input and output, so the close payload grows linearly. - Model server: the session keeps the model server's cookies across activations, so it stays on one model-server session. - A test checks that a later activation resends the earlier turns' token IDs and log probabilities. max_steps still bounds each activation, as it bounds one /v1/responses call; the Environment Server bounds the activations. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Felipe Vieira Frujeri <[email protected]> * fix(simple_agent): mark a continuation seed as a restart through the base hook Main checks that no agent overrides seed_agent_session. Simple Agent now implements the base agent's _seed_restarts hook instead: under checkpointing, a checkpoint does not export a continuation session's conversation, so the seed reply marks the episode as a restart. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Felipe Vieira Frujeri <[email protected]> * feat(environment): let a tool reply end the agent's activation A protocol whose turn ends at a submission, such as the BIRD-Interact ADK's c-Interact, must end the agent's activation without another model call. The ADK does it in a before-model callback; a Gym Environment Server sees only the tool calls, so it signals it on the reply. ToolResult.ends_activation sets X-NeMo-Gym-End-Activation: true on the direct HTTP reply. simple_agent runs the rest of the model response's tool calls and returns the activation without calling the model again. MCP has no field for it, so an MCP agent calls the model again. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Felipe Vieira Frujeri <[email protected]> * fix(simple_agent): raise AgentSessionConflictError when a restored continuation lost its conversation Main now requires every 409 session refusal in an agent to raise AgentSessionConflictError (NVIDIA-NeMo#5691, enforced by tests/unit_tests/test_session_contract_repo.py). The continuation session's refusal after a restore raised a plain HTTPException(409); it keeps the same status and detail. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Felipe Vieira Frujeri <[email protected]> * fix(simple_agent): run continuation activations through the session hook, and document continuation A continuation activation called _create_episode directly, so a subclass whose task context lives in its session state (_create_session_episode) lost it from the first activation on. It now goes through the hook, as an activation without continuation does. The comment on the trajectory said the close payload grows linearly; each turn's question still holds the model-visible prefix, as in one activation. The continuation test now checks each activation's model route and metadata. integrate-existing-agents.mdx describes simple_agent's continuation, and multi-step-tasks.mdx says which harness can continue in a lent sandbox. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Felipe Vieira Frujeri <[email protected]> * test(agent): run a Simple Agent continuation session from an Environment Server in the core suite Core coverage measures responses_api_agents/simple_agent/app.py, because core tests import it, but counts only core tests. The continuation code this PR adds is tested in the server's own suite, so core coverage fell to 94.95%, under the 95% gate. These tests drive a real Simple Agent session from a BaseEnvironmentServerWithTools episode: a tool that ends the activation ends the turn, the next activation continues the conversation, a failed activation stays in the trajectory, and an activation the session cannot run gets a 422 before any model call. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Felipe Vieira Frujeri <[email protected]> * fix(agent): apply the third review round on Simple Agent continuation - A tool result that is not JSON becomes a 500 error that no longer ends the activation, so the agent shows the model the error. - The end-activation docstrings and the MCP tutorial say that only simple_agent honors the header. - With execute_tools on, a function call cut off before its tools ran is not sent to the next activation. - Comments say what a failed activation keeps and that each turn's question keeps the whole prefix; the docs say close returns every activation's trajectory and use "borrowed sandbox". - Tests: close during an activation (incomplete, CancelledError), an activation without new input, the model server's cookie between activations, tool cookies and evidence across activations, the cut-off call. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Felipe Vieira Frujeri <[email protected]> --------- Signed-off-by: Felipe Vieira Frujeri <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
MichielMAnalytics
pushed a commit
to MichielMAnalytics/Gym
that referenced
this pull request
Nov 23, 2026
…h no Resources Server (NVIDIA-NeMo#5409) * feat(bird_interact): run BIRD-Interact in its Environment Server, with 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 NVIDIA-NeMo#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 NVIDIA-NeMo#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]> * refactor(bird_interact): start the database sandbox with start_episode_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]> * fix(bird_interact): honor the token-capture opt-out and keep the follow-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]> * fix(bird_interact): fail the episode at the agent stage when a turn's 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]> * fix(bird_interact): start no sandbox once the episode ends; name the 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]> * build(bird_interact): relock after the rebase onto main Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Felipe Vieira Frujeri <[email protected]> --------- Signed-off-by: Felipe Vieira Frujeri <[email protected]> Co-authored-by: Claude Opus 5.5 <[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.
What changed
BaseUserSimulationEnvironmentServer(nemo_gym/base_user_simulation_environment_server.py) is a base class for Environment Servers that write every user message. It owns the agent session, the turn loop, the turn and interaction deadlines, the agent close and the failure stages. A subclass implements five hooks:start_episodeagent_accessresponses_create_paramsresponses_create_params; later turns send only aUserMessage.next_user_turnUserMessageorStop(reason). It runs after every turn, the last one included.finish_episodeHow the base class runs an episode:
max_turns > 1, the seed requestsresume_harness_sessioncontinuation. An agent without it fails the episode at seed with a terminal failure.x-ng-agent-activationheader, on the episode's capture path.stop_reason="interaction_timeout".dependency_failurewith the stagesseed,agent,cleanupandverification. Every failure after the seed keeps the completed turns and the agent's observations.checkpoint_modestaysrestart_only.simple_agentnow supportsresume_harness_sessioncontinuation. It keeps the session's conversation and receives only the new input on each activation. Later activations keep the tools and instructions of the first, and one that tries to change them is refused with 422. At close the agent returns the trajectory of all activations. A continuation seed is refused when partial-rollout checkpointing is on, because checkpoints do not export the conversation.BIRD-Interact, in both of its modes, is the first subclass.
resources_servers/bird_interactholds each episode's state:preprocess_sqlapplied. The agent's SQL and the grading run there;user_model;The seed reply carries the context for the first turn's
responses_create_params. In a-Interact it leaves out the schema, the column meanings and the knowledge base, which the tools charge for. In c-Interact the Environment Server calls/c_interact/askand/c_interact/submit. In a-Interact the agent calls the same actions as nine tools at the server's root, which is Gym's convention, and over MCP (expose_tools_over_mcp: true). The names, descriptions and arguments live inschemas.A_INTERACT_TOOLS, so the agent sees the same tools over either transport. Each mode's routes refuse a session of the other mode, so an a-Interact agent cannot submit through the c-Interact route without paying its BIRD-COIN. A session's MCP token lists the nine tools in a-Interact and none in c-Interact, and MCP never exposes the/c_interact/routes. A direct HTTP grant is only a base URL and the session cookie, andsimple_agentdoes not check tool names against the declared tools, so it can reach any route through a name it was not given. fix(simple_agent): call only the tools that the request declares #5271 adds that check. The agent never gets the sandbox itself. The design RFC records the boundary between the Environment Server and the Resources Server as an open question.Session sandbox. The session starts the sandbox at seed and stops it at close. At shutdown the server stops any sandbox still open, and
ttl_slets the provider reclaim one that a crashed server left. The server uploadsgrading.pyand the database source, then runspython3 grading.py <setup|execute|grade> <request.json>in the sandbox. Requests go in an uploaded file, not on the command line, andgrading.pydeletes the file once it has read it, so the solution SQL in a grade request does not stay in the sandbox. The image needs onlypython3. The server'srequirements.txtinstallsnemo-gym[sandbox], so every provider's SDK, OpenSandbox included, is available. A command the sandbox does not run is an infrastructure failure:inconclusive_verification_retriestimes;/verifymasks the sample withbird_interact:sandbox_failed;environment_servers/bird_interactis the subclass, withmode: c_interact | a_interact.sqlorsqliteblock is a submission, and any other reply is a question.resources_tool_transports, as insingle_agent_turn, picks the grant:direct_http(the default, forsimple_agent),mcp, or both. Overmcpalone the first request declares no tools, because Codex refuses one that does.mcpwithout exposure on the Resources Server fails at seed, for good.Config:
resources_servers/bird_interact/configs/bird_interact.yamldefines one Environment Server for each mode, one shared Resources Server,user_model, and the taskset routes.Row schema:
resources_servers/bird_interact/task_data.pydescribes the dataset rows (BirdInteractTask), as every Resources Server must. It imports only Pydantic, so data tooling can load it without the server's dependencies.Example data: five tasks on a synthetic
bookshopSQLite database in the BIRD-Interact file layout. Two have a follow-up question, and two have two critical ambiguities, as most published tasks do. The config declaresexample.jsonlonce for each mode's taskset, under one dataset name, because the metrics fileexample_metrics.jsondescribes the file's rows and the taskset is only routing.example_rollouts.jsonlhas five rollouts for each mode.Data check.
gym env test +should_validate_data=true(nemo_gym/cli/env.py) wanted exactly five rows inexample_rollouts.jsonl. BIRD runs the same five examples under two tasksets, one for each mode, so it has ten. The check now wants five rollouts for each taskset in the rollouts' task IDs. Rollouts without a taskset, and the<PLACEHOLDER ROW>lines some servers commit, count as one group, so every other server needs five as before.Harness support. What each main harness's Gym adapter accepts, read from its session seed checks.
simple_agent, in both modes, and Codex, in a-Interact over MCP, have run BIRD with a model (see Rollout evidence). The table is also inenvironment_servers/bird_interact/README.md.simple_agentdirect_httpmcp, in the harness's own sandboxdirect_http, in its own sandbox.code_exec: falseleaves out its shell.opencode_config.toolsturns off its built-in tools.The gaps are in the adapters, not in BIRD: multi-turn sessions (Codex, Pi, Hermes, Stirrup, Claude Code, Kilo, OpenClaw) for c-Interact, and tool grants (Claude Code, Kilo, OpenClaw, OpenCode) for a-Interact. Neither mode grants a sandbox, because BIRD's sandbox holds the database and the ground truth. A sandboxed harness runs in its own sandbox, with built-in tools such as a shell that BIRD-Interact doesn't have. Those tools cannot reach the database, but for scores comparable with the paper's they should be off where the adapter allows it.
Why
BIRD-Interact needs both an environment-driven conversation (c-Interact) and an agent-driven one (a-Interact). Gym's current user-simulation servers (
nemo_user_sim,swe_together) each carry their own copy of the agent-session code (seed, activation, capture path, close and failure mapping). This base class puts that code in one place for the next servers. Migratingswe_togetherandnemo_user_simto it is a follow-up and is not in this PR.Refs #4160. That issue is closed as not planned, but BIRD-Interact is now planned. The design was reviewed as an internal RFC.
Validation
pytest tests/unit_tests/test_base_user_simulation_environment_server.pypytest tests/unit_tests/test_base_resources_server.py tests/unit_tests/test_session_contract_repo.pyseed_response_modeland fails with the defaultpytest responses_api_agents/simple_agent/tests/test_app.pypytest environment_servers/bird_interact/tests/mcpand submits; the request declares no tools),mcpwithout exposure failing at seed for good, and a c-Interact turn whose SQL draft in an earlier step is not submitted.pytest resources_servers/bird_interact/tests, in the server's own venvpytest tests/unit_tests/ -n 8task_data.pycommit. 26 fail the same way at the previous head and are specific to this workstation: the venv lacks thesandboxextra (opensandbox,tenacity), the localenv.yamlleaks into config tests, the host name resolves to127.0.1.1, and file modes differ under this umask. The other 2 were intest_task_data.py, becausebird_interacthad no row schema; withtask_data.pythat file passes (425 passed).pytest tests/unit_tests/test_base_user_simulation_environment_server.py tests/unit_tests/test_mcp_auto_exposure.py tests/unit_tests/test_task_data.pypytest tests/unit_tests/test_cli.pygym env test +entrypoint=resources_servers/bird_interact +should_validate_data=trueexample_rollouts.jsonlof all 170 Resources Serversbird_interact, which passes now and failed the old countpre-commit run(all files in this PR)Rollout evidence
The committed example rollouts. On the five example tasks, with the Docker provider and the same two hosted GPT models (one as the policy, one as the simulator), I ran each task once in each mode with
simple_agent. These ten rollouts aredata/example_rollouts.jsonl.bookshop_1bookshop_2bookshop_3(follow-up)bookshop_4(follow-up)bookshop_5All ten scored. None failed, none were masked, and no database sandbox was left running. In a-Interact 0.7 is the most a task without a follow-up scores, so the agent solved every task there. I read the c-Interact transcripts:
bookshop_1: the first SQL added anauthor_idcolumn, and the debug attempt switched to aLEFT JOINthat keeps authors with no bestsellers.bookshop_2: the agent asked whether "typical discount" meant a percentage or a dollar amount, the simulator answered "the average percentage discount", and the agent returned 10 for 0.10. It has scored 0.0 in every c-Interact run of this PR. In a-Interact the agent asked about the scale and the simulator answered "a fraction".bookshop_5: the agent asked nothing, took "big markdowns" as 20% off, and left out the quantity.A first run of these tasks found a defect in
bookshop_4: "Rank the countries" made the agent add aRANK()column in both modes, which fails grading. The request now reads "top country first", with the same ambiguities and ground truth, and the rollouts above are from the run after that change.At commit
65f2c194f, with the Docker provider and the same two hosted GPT models (one as the policy, one as the simulator), I ran the three example tasks with 2 repeats each:bookshop_1bookshop_2bookshop_3(with follow-up)simple_agent, direct HTTPsimple_agent, direct HTTPAll 18 rollouts scored. None failed and none were masked. Docker destroyed every sandbox: 12 database sandboxes in the
simple_agentrun, and 6 database and 6 Codex sandboxes in the Codex run. None were left running. I read the transcripts:bookshop_1dropped from 0.5 to 0.0. The first SQL is the same as in the earlier runs: aLEFT JOINthat keeps authors with no bestsellers. Earlier, the debug attempt switched to an inner join and passed; this time both debug attempts kept the extra rows. The question, the simulator's answer and the debug prompt match the earlier runs, so this is model variance, not a regression.bookshop_2fails as before.simple_agentwrites one message per turn.simple_agentin a-Interact made 43 tool calls at the root, across 8 of the 9 tools,executeincluded. None failed.+default_host=172.17.0.1and Codex's own sandbox onnetwork: host, all 6 scored. BIRD's database sandbox stayed on the bridge. The Environment Server README now describes this setup.Earlier runs, at earlier commits of this PR:
I ran
gym env start --resources-server bird_interact --model-type vllm_modelandgym eval run --no-serveon the example tasks in both modes, with 2 repeats, for 12 rollouts. The policy and the simulator were two different hosted GPT models.bookshop_1bookshop_2bookshop_3(with follow-up)All 12 rollouts scored and none failed. I read every transcript:
c-Interact scores lower than a-Interact, which is the same direction as the paper.
After moving the database into a sandbox, I ran the same 12 rollouts with the Docker provider (
python:3.12-slim). The rewards were the same: 0.50 in c-Interact and 0.80 in a-Interact, with no failures and no masked samples. Docker destroyed 12 sandbox containers, one for each episode, and none were left running. All 14submittool calls were graded in the sandbox. No agent calledexecutein this run; the unit tests cover it.Earlier smoke runs found three problems, now fixed and covered by tests:
/verifydropped the failed phase when the BIRD-COIN budget ended the task.bookshop_2in c-Interact still fails because the simulator sometimes calls the fraction "average percentage off list price". These prompts are written for Gym, so they are not the reference simulator.Compatibility
simple_agent: sessions without continuation behave as before. Thetrajectoryfield on close is new and is set only for continuation sessions.gym env test +should_validate_data=truecounts example rollouts by taskset. A server whose rollouts have no taskset still needs exactly five, so the result is unchanged for every other server's committed rollouts./a_interact/to the server's root. They are new in this PR, so nothing else used them.check_resources_session_contracttakes a keyword-onlyseed_response_model, for a server whose seed reply adds typed fields. The default,ResourcesSeedSessionResponse, still forbids extra fields, so existing callers are unchanged.Not in this PR
swe_togetherandnemo_user_simto the base class.open_participant()for a second agent session. Nothing uses it yet.environments/bird_interact/entry. The manifest copies each dataset without itstaskset(_manifest_datasetinnemo_gym/environment/validation.py) and requires unique dataset names, so BIRD's twoexampleentries, one for each mode, would fail validation. BIRD stays a Resources Server config here.bookshop_2in c-Interact (see Rollout evidence).sol_sqlwith 422);test_cases(management tasks);Code provenance
This is an independent implementation. No code or prompts are copied from
bird-bench/BIRD-Interact(MIT).grading.pyimplements the published default comparison: removeDISTINCTandROUND, round floats to two places, then compare as an ordered list or as a set.bookshopdatabase and tasks are synthetic and written for this PR (Apache 2.0).🤖 Generated with Claude Code