Repository navigation
fix(agent): keep observations from every SimpleAgent session activation - #4114
Merged
ananthsub merged 1 commit intoOct 6, 2026
Merged
Conversation
A SimpleAgent session replaced its stored observations on every /v1/responses call, so closing the session returned only the last activation's invocation. Environment servers that drive several activations through one session, such as user simulation, lost the record of every earlier activation. Accumulate records and gaps across activations. Every activation used the invocation ID "root", which the bundle requires to be unique, so later activations in a session use "activation-<n>". The first keeps "root", so single-activation sessions report what they did before. Signed-off-by: Ananth Subramaniam <[email protected]>
ffrujeri
approved these changes
Oct 6, 2026
Contributor
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/37514055561 |
ananthsub
added a commit
that referenced
this pull request
Oct 6, 2026
…ivation (4114)` into `r0.7.0` (#4123) beep boop [🤖]: Hi @ananthsub 👋, we've cherry picked #4114 into for you! 🚀 Please review and approve this cherry pick by your convenience! Signed-off-by: Ananth Subramaniam <[email protected]> Signed-off-by: NeMo Bot <[email protected]> Co-authored-by: Ananth Subramaniam <[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 does this PR do?
Makes a SimpleAgent agent session return the observations of every activation at close, not only the last one.
During a session, each
/v1/responsescall replacedstate.observationswith that call's invocation. An environment server that drives several activations through one session, such as the user simulation stack (#3800, #4080), would receive only the final activation's invocation at close, andng_agent_observationswould show one model call where there were several.single_agent_turnmakes one call per session, so it was unaffected.The fix:
"root", so accumulating them would fail the bundle's unique-ID check. Later activations in a session now useactivation-<n>. The first keeps"root", so single-activation sessions report exactly what they did before.No issue is linked; this is a follow-up to #3784, found while reviewing the SimpleAgent changes in the user simulation stack.
Validation
test_agent_session_returns_observations_from_every_activation: two activations in one session return two invocations,rootandactivation-2, each linked to its own model response. It fails without the fix.pytest responses_api_agents/simple_agent/tests environment_servers/single_agent_turn/tests environment_servers/single_agent_turn_legacy/tests: all pass.pytest tests/unit_tests/test_rollout_collection.py tests/unit_tests/test_base_responses_api_agent.py tests/unit_tests/test_rollout_observability.py: all pass.pre-commit runon the changed files: all pass.Rollouts
N/A. Single-activation sessions, which every current configuration uses, produce the same observations as before. The change affects only sessions with several activations, which the user simulation environment server introduces; that stack carries its own rollout evidence.
Compatibility
No configuration change. For sessions with more than one activation,
ng_agent_observationsnow contains one invocation per activation instead of only the last.