Skip to content

feat(observability): return the environment session id so infrastructure failures can be attributed to rollouts #2610

Closed

Description

@waple0820

#2114 landed the rollout correlation contract, and nemo_gym/rollout_correlation.py gives a resources server the current rollout id via ROLLOUT_PATH_PREFIX (nemo_gym/config_types.py:795), RolloutContextMiddleware, and current_rollout_id(), installed at nemo_gym/base_resources_server.py:139. Two gaps remain.

It is one-directional. BaseSeedSessionResponse (base_resources_server.py:119-120) is an empty model and BaseVerifyResponse carries no identifier, so the environment-side handle — the container, browser context, or provider session that actually consumed quota — never reaches the training side. #2122 states this explicitly: "No rollout identifier is added to public request schemas."

It is gated on observability. nemo_gym/server_utils.py:341-348 only applies the rollout prefix when observability_enabled is true, and base_responses_api_agent.py:96-98 returns None otherwise. That flag defaults off, so current_rollout_id() is None inside resources servers by default — including in the production runs where an incident actually happens.

Consequence: when a run degrades, the training side has rollout ids, the provider has environment session ids, and the only join key is a timestamp. Reconstructing which orphaned sessions belonged to which aborted rollouts across our GB200 incident (1172 of 1280 rollouts over steps 61–80) was done by hand; with a returned session id it would have been a groupby. This is also the environment-side half of #238, where the reporter's workaround is threading the session id manually through every call.

Proposal:

class BaseSeedSessionResponse(BaseModel):
    env_session_id: Optional[str] = None    # container / browser context / provider session, opaque to Gym

class BaseVerifyResponse(BaseVerifyRequest):
    env_session_id: Optional[str] = None    # same handle, returned with the score

plus making rollout-prefix propagation to resources servers independent of observability_enabled, or giving it its own flag. That second part needs a test covering catch-all-route environments, given the route-ordering note in the resources-server implementation guide.

Both fields are optional and default to None. No training framework needs a transport change — verl and NeMo-RL already carry the whole verify response as full_result (verl-recipe nemo_gym/agent_loop.py:460; nemo_rl/experience/rollouts.py:2735), and miles carries it in Sample.metadata. There is precedent for extending the seed response: AviarySeedSessionResponse, ToolSandboxSeedSessionResponse and ExampleMCPWeatherSeedSessionResponse already subclass it.

Related: #2114, #2122.

We are happy to implement this.

Activity

  1. added
    community-request
    on Aug 19, 2026
  2. added
    waiting-on-maintainers
    on Aug 21, 2026
  3. added 2 commits that reference this issue on Aug 25, 2026
    48e6f66
    d3267f0
  4. removed
    waiting-on-maintainers
    on Aug 29, 2026
  5. added a commit that references this issue on Aug 31, 2026
    7e4463b
  6. added
    waiting-on-maintainers
    and removed
    waiting-on-maintainers
    on Sep 9, 2026
  7. added
    waiting-on-maintainers
    on Oct 1, 2026
  8. waple0820 commented on Oct 3, 2026

    @waple0820
    ContributorAuthor

    Closing. #3717 put episode_id on both the seed request and the episode result, so an environment can log its provider handle against the rollout without returning a new field or turning on capture. #3932 does this for interactive_browser: the provider session is tagged with the episode, and the acquire log line names both. The legacy /run path is left as is, see #2613.

  9. removed
    waiting-on-maintainers
    on Oct 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    community-request

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions