Repository navigation
feat(sessions): carry the task's responses_create_params on the typed resources seed - #5987
weijiac0619 wants to merge 4 commits into
Conversation
… resources seed single_agent_turn seeds a resources session with task_data, which leaves out the task's responses_create_params, then sends them back at /verify. A server whose session is built from the task's history or tools could not build it at seed. ResourcesSeedSessionRequest gains an optional responses_create_params, and single_agent_turn fills it on the Resources server's seed, dumped as _verify_body dumps it. Tool servers' seeds do not get it. The base passes it to seed_request_model only when the model declares a responses_create_params field; every other server's task_data validates as before, and a seed without the field (an older caller) still validates. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: weijia chen <[email protected]>
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
…s none A seed without the params (every tool-server seed) dumped them as null, which a resources server built from an older Gym refuses: its ResourcesSeedSessionRequest forbids unknown fields. The key is now left out when it is unset, as ResourcesSeedSessionResponse does for its observation. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: weijia chen <[email protected]>
…omationBench sessions branch Signed-off-by: yaoyu-33 <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ped seed's params The typed seed now carries the task's responses_create_params (#5987). The seed model declares that field, and initialize_session_state refuses a row whose params carry no tools with ResourcesSeedRejectedError (HTTP 422, which the Environment Server treats as terminal), so a row prepared before this server fails before any model call instead of being masked at /verify after the episode. A seed without the params, from a caller that does not send them, is served as before. /verify no longer checks the tools. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: yaoyu-33 <[email protected]>
…he field A seed model that declares responses_create_params validates them with the task_data, but a refusal still said "task_data is not a valid ...". It now says "task_data with responses_create_params" when the params were validated. A test checks that bad params are a final 422 naming them, with no session left. Document the field in the Resources Server API page and the single_agent_turn README: declare it optional, since only single_agent_turn (and single_agent_turn_legacy) sends it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: yaoyu-33 <[email protected]>
|
/ok to test f564045 |
yaoyu-33
left a comment
There was a problem hiding this comment.
Reviewed at 6379ea6 and pushed one commit, f564045.
What held
- No in-repo consumer breaks. Servers that read typed seeds either take
ResourcesSeedSessionRequest, which now declares the field, or use their own seed model, which ignores the extra key. Tool-server seeds keep their wire shape. single_agent_turn_legacyfills the params too: its flat rows go throughmaterialize_task(row), so the Resources seed carries them, as #5971 needs.- The mixed-version 422 needs a Resources Server from another checkout or Gym release. Per-server venvs install
nemo_gymeditable from the same tree (nemo-gym = { path = "../..", editable = true }), and PyPI installs pin the parent's version. The compatibility note in the description covers it.
What f564045 changes
- A seed model that declares
responses_create_paramsand refuses them answered "task_data is not a valid …". The refusal now says "task_data with responses_create_params is not a valid …". The new testtest_params_the_seed_model_refuses_are_a_final_422_that_names_themchecks the final 422, the message, and that no session is left. It fails on 6379ea6. - Docs: the "Episode sessions" bullet in
resources-server-apis.mdxand thesingle_agent_turnREADME now describe the field. They say to declare it optional, since onlysingle_agent_turnandsingle_agent_turn_legacysend it.
Validation at f564045 (Linux, Python 3.13, openai==2.45.0 as pinned)
tests/unit_tests/server_runtime/test_typed_seed_responses_create_params.py: 5 passed. With 6379ea6'sbase_resources_server.py, the new test fails.environment_servers/single_agent_turn/tests: 246 passed.environment_servers/single_agent_turn_legacy/tests: 44 passed.tests/unit_tests/server_runtime: 1695 passed. 30 failed only because of the run's environment: its tree had noresources_servers/(27 repo-scan tests), and its venv hadmcp2.3.0 (3 intest_mcp_auto_exposure.py). None touch this change.test_locked_env.py(needsuvon PATH) andtest_review_boundary_interfaces.py(needscloudpickle) were left out.pre-commit runon the changed files passed, including guardwords and import-linter.- Not run: CI (
/ok to testis posted for f564045), and a real-model run at this head. The description's AgentArena run used ec5c669. The later commits change only the wire shape of seeds without params, the refusal text, and docs.
Description
The Validation section predates f564045 and doesn't list the new test or the docs change. Worth updating before this leaves draft.
| task_data=task_input.task_data, | ||
| # As _verify_body sends them: a server whose session is built from the task's history or tools | ||
| # reads them at seed. Tool servers' seeds do not get them. | ||
| responses_create_params=task_input.responses_create_params.model_dump( |
There was a problem hiding this comment.
Every Resources seed now carries the task's params, whether or not that server's seed model declares them. For image tasks that roughly doubles the seed payload. Servers that keep seed bodies also hold it for the whole session: terminal_bench_4 stores body.model_copy(deep=True) per session (resources_servers/terminal_bench_4/app.py:497).
The description lists this as a known limit, so not blocking. If a large-image benchmark hits it, would an opt-in on the Environment Server (send the params only to Resources Servers that ask for them) be the way to go?
…sponses-create-params Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: weijia chen <[email protected]>
|
/ok to test 2b78f17 |
| # The task's own responses_create_params, which task_data leaves out: the prompt params /verify also receives. | ||
| # A server whose seed_request_model declares a `responses_create_params` field gets them in its seed request, | ||
| # for a session built from the task's history or tools; every other server's task_data validates as before. | ||
| responses_create_params: dict[str, JsonValue] | None = None |
There was a problem hiding this comment.
if this is needed, it points to a separate gap in the design. this wont generalize well for multiple agents, and will confuse other users. lets discuss the design gaps outside of this PR
There was a problem hiding this comment.
Thanks. Happy to take the design discussion outside this PR. The need: AgentArena’s resources server builds its session (a replayed workspace and the tool simulator’s prompt) from the row’s history, tools and instructions, and today the typed seed gives it only task_data. Options I can see:
- The benchmark’s data puts what the server needs into task_data. No core change, but the history and tools are stored twice per row.
- A benchmark-specific Environment Server that passes the params to this resources server only.
- This PR: the seed carries responses_create_params, and only servers whose seed model declares the field receive it.
There was a problem hiding this comment.
what about migrating the resources server to be an environment server? then it can seed the state however it needs to from the whole row, while passing the agent harness a restricted subset
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
SHIP
LGTM — no concerns found.
I reviewed all six changed files and traced the affected paths. The Resources seed uses the same serialization as verification, while tool-server seeds omit the new field. The typed-seed validation preserves task-only and cookie-seed behavior. I also checked legacy delegation, session ownership, MCP restrictions, regression tests, and documentation.
This was a static review. I didn't execute tests or independently verify the reported rollout results.
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.
Pull request was converted to draft
…ons and run it through single_agent_turn (NVIDIA-NeMo#5961) * feat(automationbench): serve AutomationBench as typed resources sessions Add resources_servers/automationbench. Each typed resources session holds one task's simulated SaaS world, built from the row's initial_state as upstream's AutomationBenchEnv.setup_state builds it. POST /api_search, /api_fetch and /base64_encode run upstream's api toolset on that world through Gym's automationbench_env, and the model gets tool text and error text as verifiers words them. /verify scores the final world with the benchmark's rubric: aa_headline by default, with partial_credit, task_completed_correctly and the guardrail and objective counts alongside. A raising rubric masks the sample as verifier_error. prepare.py now writes the environment's tool schemas and the 131072-token output budget into each row's responses_create_params, so a Gym agent can offer the tools. verifiers_agent reads neither. The example rows gain the same two fields. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: weijia chen <[email protected]> * feat(automationbench): run the benchmark through single_agent_turn and keep the verifiers recipe as config_legacy_agent benchmarks/automationbench/config.yaml now runs simple_agent (50 model calls, verifiers' max_turns) through single_agent_turn_legacy against the automationbench resources server, with direct HTTP tool access. The previous verifiers_agent recipe behind the legacy_agent relay is kept, unchanged apart from a deprecation comment, as config_legacy_agent.yaml with its own deprecated manifest. The README describes both recipes, their sampling and the per-assertion export of each. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: weijia chen <[email protected]> * fix(automationbench): mask rows without tools, pin session sampling, drop the stale agent_ref - /verify masks a sample as verifier_error when the row's responses_create_params carries no tools: rows prepared before the resources server lack them, the model cannot act on the world, and the zero they would score is no grade of the model. The reason names `gym eval prepare --benchmark automationbench`. - config.yaml sets the run's responses_create_params to temperature and top_p 1.0, the sampling config_legacy_agent.yaml sends from its agent config. Rows still carry neither, since verifiers_agent lets a row's value win over its config. - prepare.py and the example rows no longer write agent_ref: verifiers_agent. Dataset collation strips a row's agent_ref and routes by the declaring instance (`automationbench` in both recipes), so the field only produced a warning. - Both READMEs say the resources server reuses verifiers' tool dispatch as a transitional choice for exact tool parity, and what dropping verifiers would take. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: weijia chen <[email protected]> * feat(sessions): carry the task's responses_create_params on the typed resources seed single_agent_turn seeds a resources session with task_data, which leaves out the task's responses_create_params, then sends them back at /verify. A server whose session is built from the task's history or tools could not build it at seed. ResourcesSeedSessionRequest gains an optional responses_create_params, and single_agent_turn fills it on the Resources server's seed, dumped as _verify_body dumps it. Tool servers' seeds do not get it. The base passes it to seed_request_model only when the model declares a responses_create_params field; every other server's task_data validates as before, and a seed without the field (an older caller) still validates. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: weijia chen <[email protected]> * fix(sessions): leave responses_create_params off a typed seed that has none A seed without the params (every tool-server seed) dumped them as null, which a resources server built from an older Gym refuses: its ResourcesSeedSessionRequest forbids unknown fields. The key is now left out when it is unset, as ResourcesSeedSessionResponse does for its observation. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: weijia chen <[email protected]> * build(automationbench): refresh the resources server lock for openai 2.45.0 main moved the root openai pin to 2.45.0; the component lock check runs on the merge. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: weijia chen <[email protected]> * fix(automationbench): keep counted-zero tasks in their domain, version the session recipe 0.2.0 - compute_metrics labels a task that no /verify reached by its task_id prefix, so a task counted as zero under count_missing_rollouts_as_zero / count_failure_classes_as_zero stays in its domain's denominator. A domain any repeat reports wins. - benchmarks/automationbench/manifest.yaml moves to 0.2.0; config_legacy_agent keeps 0.1.0, the version earlier results were reported under. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: weijia chen <[email protected]> * feat(automationbench): refuse a row without tools at seed from the typed seed's params The typed seed now carries the task's responses_create_params (NVIDIA-NeMo#5987). The seed model declares that field, and initialize_session_state refuses a row whose params carry no tools with ResourcesSeedRejectedError (HTTP 422, which the Environment Server treats as terminal), so a row prepared before this server fails before any model call instead of being masked at /verify after the episode. A seed without the params, from a caller that does not send them, is served as before. /verify no longer checks the tools. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: yaoyu-33 <[email protected]> * fix(automationbench): keep the /verify no-tools mask for a seed without the task's params A caller whose typed seed does not carry responses_create_params cannot be checked at seed, so /verify still masks a row without tools as verifier_error instead of scoring it 0. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: yaoyu-33 <[email protected]> * fix(automationbench): refuse a task whose initial_state the world rejects at seed WorldState validation failed inside initialize_session_state as a plain exception, so /seed_session answered 500 and the Environment Server dispatched the whole episode again. The typed seed contract asks for ResourcesSeedRejectedError (422, terminal) when no retry can make the seed succeed. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: yaoyu-33 <[email protected]> * docs(automationbench): say that seeds refuse rows without tools and unbuildable worlds Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: yaoyu-33 <[email protected]> * fix(ci): validate manifest-backed component data and verifier fixtures Signed-off-by: yaoyu-33 <[email protected]> * test(benchmarks): return valid dataset reports from composition stubs Signed-off-by: yaoyu-33 <[email protected]> * fix(ci): scope release rehearsal changelogs to PR changes Signed-off-by: yaoyu-33 <[email protected]> * fix(automationbench): cap simple_agent at 49 steps, write the search index before workers start, declare datasets - config.yaml: max_steps 49. verifiers' max_turns 50 never runs the 50th call's tool calls; simple_agent runs a call's tool calls before it checks max_steps, so 49 caps both at 49 tool rounds on the scored world. - setup_webserver runs one api_search, so the main process writes upstream's schema index (a non-atomic first-use write) before uvicorn starts any worker. - pyproject declares datasets, which tool_env() imports for its placeholder dataset; lock refreshed. - README: verifiers stays a dependency through automation-bench itself; only the git pin is the dispatch's cost. Note that the server runs with several workers. - test_sessions_hold_separate_worlds also checks the first session's world after the second seed. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: weijia chen <[email protected]> * fix(ci): restore valid secrets baseline JSON Signed-off-by: yaoyu-33 <[email protected]> --------- Signed-off-by: weijia chen <[email protected]> Signed-off-by: yaoyu-33 <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: yaoyu-33 <[email protected]>
What and why
single_agent_turnseeds a resources session with the task'stask_data, which leaves out the task'sresponses_create_params. It then sends those params back at/verify(_verify_body). A resources server whosesession is built from the task's history or tools therefore cannot build it at seed. Today such a server has to get
the prompt some other way. The first case is AgentArena's
agentic_turn_simulation(#5971): its session replays therow's history into a model of the agent's files and prepares the tool simulator's prompt from the row's tools and
instructions.
This PR lets the typed seed carry the params:
ResourcesSeedSessionRequestgains an optionalresponses_create_params.single_agent_turnfills it on the Resources server's seed, dumped exactly as_verify_bodydumps it(
mode="json", exclude_unset=True). Tool servers' seeds (_seed_tool_servers) do not get it.ResourcesSeedSessionResponsedoes for an unsetobservation. Tool-server seeds therefore keep their wire shape.SimpleResourcesServerpasses it intoseed_request_modelonly when that model declares aresponses_create_paramsfield. No server in the repository declares one today, so every existing server'stask_datavalidates exactly as before, including models withextra="forbid".not a valid ...", so it names the params too.
resources-server-apis.mdxand thesingle_agent_turnREADME describe thefield. They say to declare it optional, since only
single_agent_turn(andsingle_agent_turn_legacy) sends it.No issue is linked: the work is tracked internally.
Compatibility
responses_create_params, which validates and leaves the fieldNone.leave the key out. The Resources server's seed does not. It carries
responses_create_params, and the olderResourcesSeedSessionRequestforbids unknown fields, so that seed gets 422. Run the Environment Server and itsResources server from the same Gym version. In practice this needs a Resources server from another checkout or Gym
release: per-server venvs install
nemo_gymeditable from the same tree, and PyPI installs pin the parent's version.responses_create_params. That is the same payload/verifyalready receives for the same episode.mcp_allowed_tools_for_session(stilltask_data), close, verify or checkpointing.Validation
Unit tests
New tests:
tests/unit_tests/server_runtime/test_typed_seed_responses_create_params.py, 5 tests:task_dataas before, and still refuses a bad one;environment_servers/single_agent_turn/tests/test_app.py: the Resources seed carries the task'sresponses_create_params, and the tool-server seed's JSON has no such key.Run at the head commit (after merging main), in a fresh environment with the pinned
openai:tests/unit_tests/server_runtime,tests/unit_tests/test_session_contract_repo.pyandtests/unit_tests/test_public_api_facades.py: 2801 passed.environment_servers/single_agent_turn/tests: 281 passed.environment_servers/single_agent_turn_legacy/tests: 47 passed.Real runs
None on this branch alone, since no server here declares the field. Its consumer, #5971, ran this PR's first commit
with a Nemotron checkpoint. The later commits change only the wire shape of seeds without params (those rows'
Resources seed always has them), the refusal text and docs, plus a merge of main:
single_agent_turn_legacy: 3 of 3 rows completed and scored, none masked or failed.Checks
pre-commit runon the changed files passed at the head commit, including ruff, ruff-format and import-linter. The private guardwordscatalog was unavailable, so that hook skipped.
Known limits
responses_create_paramsreceives them. A server thatwants them under another name, or merged into its own fields, still has to declare that field.
responses_create_params, whether or not itsseed model declares them. For a task with a long history or base64 images that roughly doubles what the episode
sends to that server, since
/verifyalready sends the same params. Only the Resources server's seed pays it, buta server that keeps its seed body holds the params for the whole session (
terminal_bench_4keeps a deep copy).If a large-image benchmark hits this, an opt-in on the Environment Server (send the params only to Resources
servers configured to want them) would remove the cost for everyone else.
single_agent_turn(andsingle_agent_turn_legacy, which runs through it)fills the field. Other Environment Servers that send typed seeds (
harbor,swe_together,nemo_user_sim) leaveit unset.
🤖 Generated with Claude Code