Repository navigation
feat: define core episode types - #3483
Conversation
|
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. |
f7e6000 to
72b2e94
Compare
72b2e94 to
2181e7e
Compare
39ad4b9 to
ff913f0
Compare
ff913f0 to
1618e0e
Compare
1618e0e to
e5ede3f
Compare
9bfb0f1 to
4a52642
Compare
yaoyu-33
left a comment
There was a problem hiding this comment.
LGTM for the shared task and episode contracts. The reviewed source and tests are unchanged in the updated head.
## What does this PR do?
Registers `environment_servers` as a first-class Gym server type for
configuration, discovery, startup, addressing, status, and telemetry.
## Interaction flow
```mermaid
sequenceDiagram
participant C as Rollout collector
participant E as Environment Server
participant R as Task / Resources Server
participant A as Agent Server
participant M as Model Server
participant S as Task sandbox
C->>E: POST /run
E->>R: Seed task session
R-->>E: Tool access and optional SandboxAccess
E->>A: Seed agent session
A->>S: Connect as borrower when supplied
E->>A: Invoke /v1/responses
A->>M: Model and capture requests
A-->>E: Agent response
E->>A: Close agent session
E->>R: Verify response
E->>R: Close task session
E-->>C: Episode result
```
The Environment Server coordinates ordering and the final result. Agent
and Task/Resources Servers retain ownership of the state and resources
they create.
This is part 1 of 13 in the Environment Server stack. Previous: `main`.
Next: [#3483](#3483).
## Validation
- `uv run pytest tests/unit_tests/test_global_config.py -q`
## Rollouts
See the final PR for end-to-end rollout evidence.
## Compatibility and benchmark impact
Existing Agent Server routing remains available during migration.
Signed-off-by: Ananth Subramaniam <[email protected]>
The merge-base changed after approval.
|
EpisodeId currently only models linear retries (rollout_id + attempt), with no parent/child or branch-path concept. For subagents, multi agent, complex agentic systems that dont look like a harness, in general tree/forest-style, might need lineage in this identity type. retrofitting that once rollout_collection.py, reverification, and metrics all depend on the flat shape will be more expensive than adding it now. Should we add a parent_episode_id/branch-path field (even unused today) before this type gets more callers, and re-derive capture_key's injectivity proof to account for it? also the sandbox owner/borrower contract in #3545 is 1:1 with no fork/multi-borrower consideration |
Where we'd need child episode identity is if we supported Environment Servers calling other Environment Servers /run endpoints, which is out of scope for now.
we can have many:1 sandbox borrower to owner access. multiple agent sessions can receive the same descriptor. we don't have a sandbox fork capability exposed yet, which is separate from this PR. |
Signed-off-by: Ananth Subramaniam <[email protected]>
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/35733914924 |
What does this PR do?
Adds only the shared episode identity and envelope in
nemo_gym/episode_types.py:EpisodeId, minimalTaskId,MaterializedTask, base request/response, and handled failure.TaskIdcontains onlytasksetandtask_id. Taskset names use the<environment>:<taskset>convention when a run blends tasksets.Single-agent interaction flow
This diagram shows the built-in single-agent use case. Other Environment Server protocols may coordinate different participants and use different request, result, and lifecycle flows.
sequenceDiagram participant C as Rollout collector participant E as Environment Server participant R as Task / Resources Server participant A as Agent Server participant M as Model Server participant S as Task sandbox C->>E: POST /run E->>R: Seed task session R-->>E: Tool access and optional SandboxAccess E->>A: Seed agent session A->>S: Connect as borrower when supplied E->>A: Invoke /v1/responses A->>M: Model and capture requests A-->>E: Agent response E->>A: Close agent session E->>R: Verify response E->>R: Close task session E-->>C: Episode resultThe Environment Server coordinates ordering and the final result. Agent and Task/Resources Servers retain ownership of the state and resources they create.
This is part 2 of 14 in the Environment Server stack. Previous: #3482. Next: #3484.
Validation
uv run pytest tests/unit_tests/test_episode_types.py -qRollouts
See the final PR for end-to-end rollout evidence.
Compatibility and benchmark impact
No agent, resources, tool, or sandbox lifecycle contract is included.