Repository navigation
Conversation
93f7dc1 to
c745dda
Compare
c745dda to
a1d407b
Compare
|
@ffrujeri Summary of my comment on UserSim#10, from the Gym side. This PR removes the duplicate probe. For Gym episodes to reproduce standalone NeMo UserSim runs of the same input row, UserSim needs to own the episode inputs and the episode loop, with the Gym code staying generic. New probes, themes and options then reach Gym without Gym code changes. Episode inputs
Episode loop
Proposed rework (keeps this PR's split: Resources owns the episode, the Assistant Agent owns the model/tool loop, the Environment coordinates)
A prototype of the session on the same stack matched standalone runs on 14/14 probes in both modes, and 42/42 concurrent episodes (details in UserSim#10). |
a1d407b to
854f584
Compare
8b97ff2 to
2b128e7
Compare
2b128e7 to
d213a11
Compare
958338e to
e52359f
Compare
|
Still open
Also:
The UserSim-side changes are listed on UserSim#15. Happy to make those changes on usersim! |
Addresses the review on #3791 and adopts the reworked UserSim contract from NVIDIA-NeMo/UserSim#15. The Assistant Agent no longer runs the probe's tools. It makes one model call per activation and returns the model's tool calls unexecuted; UserSim executes them inside its own conversation loop when the Environment records that response, so the turn and call indices, the tool simulator's context, and the loop's own decisions stay UserSim's. - Re-pins UserSim to a4665b3, where standalone `usersim simulate` builds its Data Designer pipeline again. - Declares the models this environment runs per role, with their token budgets, when seeding. Without them `identity_disclosure` ran with no expected identity and trajectory ids named preparation's defaults rather than the models under test. - Returns reasoning and usage with every recorded response; UserSim stores both. - `AgentToolLoopPolicy` leaves Gym's general-purpose agent contract, along with the tool-access batch path. In their place `AgentSeedSessionRequest` carries one generic `execute_tools` flag for callers that run tools themselves. SimpleAgent loses the synthesis, activation-cap and per-turn-cap logic that only existed to mirror UserSim's loop. - Contract errors from the runtime return HTTP 422 to their author instead of being retried against, or attributed to, the model under test. - Drops the tool and batch routes, the tool-call-id header and the MCP/HTTP tool transports for probe tools: nothing executes them host-side now, so parallel calls can no longer be split across rounds by transport. - Loads UserSim's probe registry and assets at Resources startup rather than during the first episodes, where it stalled the event loop. - Points the simulated user at the support model; it was the policy model, so the model under test was interviewing itself. - Closes the runtime through its own `close()` and finalizes through the public lifecycle state rather than private attributes. Tests: end-to-end parity against a standalone generator run for all 14 registered probes through the real Resources/Environment/SimpleAgent stack, declared role models, a rejected contract error, and `execute_tools: false` returning tool calls after exactly one model call. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Signed-off-by: Felipe Vieira Frujeri <[email protected]>
Addresses the review on #3791 and adopts the reworked UserSim contract from NVIDIA-NeMo/UserSim#15. Keeps this PR's split: Resources owns the episode, the Assistant Agent owns the model/tool loop, the Environment coordinates. The Agent still drives model -> tool -> model, but it no longer decides the loop's shape. Per step it calls its model, records that response with Resources *before* issuing the response's tool calls, and follows the reply: whether the turn continues, which tools are offered next, and the exact input UserSim would send. Recording is what makes UserSim execute the calls, inside its own conversation loop, so the turn and call indices and the tool simulator's context are UserSim's. The reply's input replaces the Agent's own accumulated transcript, which matters for probes that trim their context. That removes `AgentToolLoopPolicy` from Gym's general-purpose agent contract along with the tool-access batch path, and with them SimpleAgent's synthesis, activation-cap and per-turn-cap logic, which only existed to mirror rules UserSim already enforces. In their place the agent session carries `record_outputs_path` and a generic `execute_tools` for agents that cannot record. - Re-pins UserSim to a4665b3, where standalone `usersim simulate` builds its Data Designer pipeline again. - Declares the models this environment runs per role, with their token budgets, when seeding. Without them `identity_disclosure` ran with no expected identity and trajectory ids named preparation's defaults. - Returns reasoning and usage with every recorded response; UserSim stores both. - Contract errors return HTTP 422 to their author rather than being retried against, or attributed to, the model under test. - Drops the tool batch route and its transport flag: parallel calls now arrive together in one recorded response, so they can no longer be split across rounds by transport. - Loads UserSim's probe registry and assets at Resources startup rather than during the first episodes, where it stalled the event loop. - Points the simulated user at the support model; it was the policy model, so the model under test was interviewing itself. - Closes the runtime through its own `close()` and finalizes through the public lifecycle state rather than private attributes. Tests: end-to-end parity against a standalone generator run for all 14 registered probes through the real Resources/Environment/SimpleAgent stack, the record reply driving the Agent's loop, declared role models, a rejected contract error, and the tool route returning UserSim's payload verbatim. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Signed-off-by: Felipe Vieira Frujeri <[email protected]>
4b45886 to
20b4e5f
Compare
Addresses the review on #3791 and adopts the reworked UserSim contract from NVIDIA-NeMo/UserSim#15. Keeps this PR's split: Resources owns the episode, the Assistant Agent owns the model/tool loop, the Environment coordinates. The Agent still drives model -> tool -> model, but it no longer decides the loop's shape. Per step it calls its model, records that response with Resources *before* issuing the response's tool calls, and follows the reply: whether the turn continues, which tools are offered next, and the exact input UserSim would send. Recording is what makes UserSim execute the calls, inside its own conversation loop, so the turn and call indices and the tool simulator's context are UserSim's. The reply's input replaces the Agent's own accumulated transcript, which matters for probes that trim their context. That removes `AgentToolLoopPolicy` from Gym's general-purpose agent contract along with the tool-access batch path, and with them SimpleAgent's synthesis, activation-cap and per-turn-cap logic, which only existed to mirror rules UserSim already enforces. In their place the agent session carries `record_outputs_path` and a generic `execute_tools` for agents that cannot record. - Re-pins UserSim to a4665b3, where standalone `usersim simulate` builds its Data Designer pipeline again. - Declares the models this environment runs per role, with their token budgets, when seeding. Without them `identity_disclosure` ran with no expected identity and trajectory ids named preparation's defaults. - Returns reasoning and usage with every recorded response; UserSim stores both. - Contract errors return HTTP 422 to their author rather than being retried against, or attributed to, the model under test. - Drops the tool batch route and its transport flag: parallel calls now arrive together in one recorded response, so they can no longer be split across rounds by transport. - Loads UserSim's probe registry and assets at Resources startup rather than during the first episodes, where it stalled the event loop. - Points the simulated user at the support model; it was the policy model, so the model under test was interviewing itself. - Closes the runtime through its own `close()` and finalizes through the public lifecycle state rather than private attributes. Tests: end-to-end parity against a standalone generator run for all 14 registered probes through the real Resources/Environment/SimpleAgent stack, the record reply driving the Agent's loop, declared role models, a rejected contract error, and the tool route returning UserSim's payload verbatim. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Signed-off-by: Felipe Vieira Frujeri <[email protected]>
20b4e5f to
bd99602
Compare
Addresses the review on #3791 and adopts the reworked UserSim contract from NVIDIA-NeMo/UserSim#15. Keeps this PR's split: Resources owns the episode, the Assistant Agent owns the model/tool loop, the Environment coordinates. The Agent still drives model -> tool -> model, but it no longer decides the loop's shape. Per step it calls its model, records that response with Resources *before* issuing the response's tool calls, and follows the reply: whether the turn continues, which tools are offered next, and the exact input UserSim would send. Recording is what makes UserSim execute the calls, inside its own conversation loop, so the turn and call indices and the tool simulator's context are UserSim's. The reply's input replaces the Agent's own accumulated transcript, which matters for probes that trim their context. That removes `AgentToolLoopPolicy` from Gym's general-purpose agent contract along with the tool-access batch path, and with them SimpleAgent's synthesis, activation-cap and per-turn-cap logic, which only existed to mirror rules UserSim already enforces. The agent contract gains one field in their place: `record_outputs_path`. - Re-pins UserSim to a4665b3, where standalone `usersim simulate` builds its Data Designer pipeline again. - Declares the models this environment runs per role, with their token budgets, when seeding. Without them `identity_disclosure` ran with no expected identity and trajectory ids named preparation's defaults. - Returns reasoning and usage with every recorded response; UserSim stores both. - Contract errors return HTTP 422 to their author rather than being retried against, or attributed to, the model under test. - Drops the tool batch route and its transport flag: parallel calls now arrive together in one recorded response, so they can no longer be split across rounds by transport. - Loads UserSim's probe registry and assets at Resources startup rather than during the first episodes, where it stalled the event loop. - Points the simulated user at the support model; it was the policy model, so the model under test was interviewing itself. - Closes the runtime through its own `close()` and finalizes through the public lifecycle state rather than private attributes. Tests: end-to-end parity against a standalone generator run for all 14 registered probes through the real Resources/Environment/SimpleAgent stack, the record reply driving the Agent's loop, declared role models, a rejected contract error, and the tool route returning UserSim's payload verbatim. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Signed-off-by: Felipe Vieira Frujeri <[email protected]>
bd99602 to
d25962f
Compare
0a21016 to
e52359f
Compare
52b9a34 to
c7c0684
Compare
e3bf84f to
ad73e0b
Compare
|
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. |
Summary
ProbeEpisodeRuntime.from_resolved_row(row, models=...)X-NeMo-Gym-Turn-Index/X-NeMo-Gym-Call-Indexheaders and let UserSim assign semantic indices{result: ...}wrapping4fd4c800bbef8883329543df632f328860fc6429Why
This consumes the canonical external execution API from UserSim PR #15 and addresses the four reviewer concerns without changing Gym PR #3797.
Validation
Live rollout evidence
All runs used
/home/ffrujeri/nemo-gym/env.yamlwithout exposing credentials, one prepared row, one repeat, and concurrency 1. An initial policy reasoning-parser mismatch was corrected with+policy_uses_reasoning_parser=true; bounded upstream HTTP 503 retries occurred, then all final runs completed.tool_calling: 1/1 completed; trajectory9be739c21d9596e2; revision4fd4c800...; conversation status true; 5 turns; 2 tool calls; reward 0.0;mask_sample=false; no failure kind; native scenario incomplete due model behaviorsafety_agentic: 1/1 completed; trajectory26f4b7560537cd59; revision4fd4c800...; conversation status true; 1 turn; 1 tool call; native index(0, 0); reward 0.8666666666666667; scenario complete;mask_sample=falsefinancial_services: 1/1 completed; trajectoryea8d7d13ca6b4da7; revision4fd4c800...; conversation status true; 4 turns; 2 native tool calls; reward 0.5333333333333333; scenario complete;mask_sample=falsenon-json,JSONDecodeError, or evidence-mismatch retry markers occurredCompatibility
This intentionally replaces the old scenario/context seed shape and host index headers with the pinned resolved-row and UserSim-owned-index contracts. Standard DirectHTTP behavior is unchanged unless an optional typed
batch_pathis configured.