Repository navigation
docs(agent): organize agent-server pages by reader - #4713
Conversation
Give each agent-server page one reader. - Configure Agents: add a "Choose a Path" chooser (integrated agent, Remote Agent, Agent Server adapter, custom Environment Server) and a score to training route, and note that an Environment Server, not the agent, orders seed and verify. - Integrate Existing Agents: add a catalog of the sandboxed harnesses with their model API, tool grants, token-ID status and declared benchmarks, and move the experiment and swap walkthrough here from the harness guide. Drop the agent session hooks section; the guide owns that contract. - Drive a Remote Agent: state what it gives and what it does not, and stop saying training works unchanged. - Add or Update a Harness: keep only adapter-author content, link to the moved sections, and carry over the two statements that existed only in the old hooks section. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Signed-off-by: yaoyu-33 <[email protected]>
yaoyu-33
left a comment
There was a problem hiding this comment.
Team review of #4713 (docs only: the four agent-server pages).
The moves are clean. The experiment and swap walkthrough moved byte-for-byte, every statement from the removed "Agent session hooks" and "Existing Agents" sections still lives in the guide, and nothing in the repo links to the removed anchors. The catalog's Declared and Not declared cells match allowed_agents in both benchmark configs. The Model API and tool-grant cells match the adapter code. The two statements added to the guide (_require_agent_session(), and process-group cancellation with setsid()) match base_responses_api_agent.py and process_supervisor.py. All 46 internal links resolve, the chooser flowchart renders, and fern check passes. lafrancef's two #3917 fixes (the sandbox-policy criterion and the GYM_HOST discovery command) are still present after the move.
PR description
- The description says the Hermes row "returns token IDs in its result"; it needs the same evaluation-only caveat as the inline comment.
- The description states the index note as a general rule ("an Environment Server, not the agent, orders seed and verify"). It holds only for session-based Environment Servers.
- The list of removed anchors leaves out
#configure-the-adapter-and-an-experiment(the guide heading is now "Configure the adapter"). Nothing links to it. - "Moved ... with links made absolute" understates the chooser: it gained an "Already integrated?" branch and an Integrate Existing Agents row, and "What you build" became "What you do".
- "Review feedback on draft #3917 asked to treat the agent-server pages together": we could not find that feedback on #3917 or its linked issue. Could you link the source, or drop the attribution?
Process
- CI has not run yet; copy-pr-bot is waiting for
/ok to test <sha>. - Two checklist boxes are unchecked: "read the contributing guidelines" and "the change is focused".
Reviewed by 5 agents (core-library expert, agent-harness expert, bug finder, test agent, devil's advocate) plus a stack-wide comment reviewer.
Generated by Claude Code
|
|
||
| | Harness | Model API | Resources tool grants | Token IDs and logprobs | SWE-bench Pro | Terminal Bench 2.1 | | ||
| | --- | --- | --- | --- | --- | --- | | ||
| | Hermes (`hermes_agent`) | Chat Completions | MCP only | Returned in the result | Declared | Not declared | |
There was a problem hiding this comment.
integrate-existing-agents.mdx:21
[DOC] RISK. Next to rows that say "evaluation only", "Returned in the result" makes Hermes read as the training-ready sandboxed harness, and Configure Agents sends readers to this row for training status. The Hermes README says sandbox mode "must not be used to produce RL training data", because commands the model runs can also write the output.json that carries the token IDs (README.md#L139; read at sandbox.py#L174, copied at app.py#L160-L162). Could the cell carry that caveat? The PR description's "Hermes returns token IDs in its result" needs the same note.
| | Hermes (`hermes_agent`) | Chat Completions | MCP only | Returned in the result | Declared | Not declared | | |
| | Hermes (`hermes_agent`) | Chat Completions | MCP only | Returned in a result file that the model can also write; evaluation only | Declared | Not declared | |
|
|
||
| ## Existing Agents | ||
| <Note> | ||
| The pseudocode shows an agent that owns the whole episode through its `/run` endpoint. When an [Environment Server](/main/about/architecture#environment-server) runs the episode, it calls `seed_session` and `verify` on the Resources server and drives the agent through session endpoints, so the agent does not decide when to verify. |
There was a problem hiding this comment.
[DOC] RISK. Every rollout reaches its agent through an Environment Server, so "When an Environment Server runs the episode" always applies, but only session-based servers order seed and verify. Agents without one, including the Remote Agent quickstart, get a generated legacy_agent relay (global_config.py#L1150-L1158) that forwards /run, and the agent seeds and verifies itself (remote_agent/app.py#L394, #L430). This wording also avoids "owns the episode", which the chooser below uses for a custom Environment Server.
| The pseudocode shows an agent that owns the whole episode through its `/run` endpoint. When an [Environment Server](/main/about/architecture#environment-server) runs the episode, it calls `seed_session` and `verify` on the Resources server and drives the agent through session endpoints, so the agent does not decide when to verify. | |
| The pseudocode shows an agent that runs the whole episode itself through its `/run` endpoint. Most agents run this way today, including Remote Agent: rollout collection reaches them through a `legacy_agent` Environment Server that relays `/run` unchanged (see [system design](/main/infrastructure/engineering-notes/system-design)). Agents that implement agent sessions, such as SimpleAgent and the [sandboxed harnesses](/main/agent-server/integrate-existing-agents#sandboxed-harnesses), can instead run under an [Environment Server](/main/about/architecture#environment-server) such as `single_agent_turn`, which calls `seed_session` and `verify` on the Resources server and drives the agent through session endpoints. In that case, the agent does not decide when to verify. |
…erver-pages Keep this branch's removal of the experiment walkthrough from the guide; the two walkthrough fixes from the guide branch are applied to the moved copy in integrate-existing-agents.mdx. Signed-off-by: yaoyu-33 <[email protected]>
- index: most agents, including Remote Agent, still run their own episode behind a legacy_agent relay; only a native Environment Server orders seed and verify. - Catalog: Hermes returns token IDs in a file the model can also write, so its sandbox mode is evaluation only; name the --allow-unsupported-pairing flag; point the older *_sandboxed_agent adapters in allowed_agents to Compare Harnesses. - Walkthrough: apply the guide's cleanup_timeout_seconds and pairing-flag fixes to the moved copy. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: yaoyu-33 <[email protected]>
ffrujeri
left a comment
There was a problem hiding this comment.
Approving. I checked the harness catalog against main: the Declared / Not declared cells match allowed_agents in swebench_pro.yaml and terminal_bench_2_1.yaml, and the Model API and token-ID cells match the adapter READMEs.
One non-blocking question: the catalog copies support status from the READMEs and benchmark YAML by hand, so it will go stale when someone changes an allowed_agents list or an adapter's training support. Do you have a plan for keeping it in sync, such as generating it from the configs (like the README resources-server table) or adding a check? Fine as a follow-up issue rather than in this PR.
|
/ok to test 2d2d8f0 |
Signed-off-by: yaoyu-33 <[email protected]>
|
/ok to test 38d41fd |
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/39488122365 |
Merge origin/main while preserving the PR runtime changes. Keep the guide reorganization from NVIDIA-NeMo#4713 and move AgentSeedRejectedError guidance into the harness integration contract, replacing the obsolete Hermes 500 caveat. Validation: 251 focused core tests and 154 SimpleAgent/episode lifecycle tests passed; pre-commit run --all-files passed; Fern check passed (redirect checks skipped because local Fern authentication is unavailable). All 16 non-documentation PR diffs are unchanged by the merge. No model rollout was run for this documentation-only conflict resolution. Signed-off-by: yaoyu-33 <[email protected]>
What does this PR do?
Give each agent-server page one reader. People who run an agent that Gym already integrates, people who bring an agent it does not, and adapter authors need different pages.
index)legacy_agentrelay, and that a native Environment Server such assingle_agent_turnorders seed and verify for agents with sessions.*_sandboxed_agentadapters to Compare Harnesses. Move the experiment and swap walkthrough here from the guide. Remove the agent session hooks section.Most content is moved, not rewritten:
_require_agent_session()rule, and why cancelling provider exec too early can kill the supervisor (the process-group leader, as with the local provider;setsid()alone does not help).Slugs are unchanged, so no redirects are needed. Heading anchors removed from the guide (
#choose-an-integration-path,#configure-the-adapter-and-an-experiment, now#configure-the-adapter,#configure-an-experiment, and#swap-the-agent-or-the-benchmark) exist only in drafts of this guide.The catalog summarizes each adapter's README and the
allowed_agentslists inswebench_pro.yamlandterminal_bench_2_1.yamlon mainb3103ea8a. Declared means the agent is in that list; it is not a validation.opencode_agentis not in the SWE-bench Pro list on main, and its README documents an explicit opt-in for that pairing. The token-ID column reflects README statements: Pi, Codex, and OpenClaw are evaluation only, OpenCode's session path is evaluation only, and Hermes returns token IDs in a result file that the model can also write, so its README limits sandbox mode to evaluation. The older*_sandboxed_agentadapters that both lists also name (opencode_sandboxed_agent,hermes_sandboxed_agent,terminus_2_sandboxed_agent) run their own episode behindlegacy_agent; the catalog points to Compare Harnesses for them instead of listing them.Stack: 1. architecture, 2. harness guide, 3. this PR. It depends on both: the new pages link to
/main/about/architecture#environment-serverand to the guide.Tracks GYM-1011.
Validation
October 20 main sync (
38d41fd788b17528d9da86467e717e255bb168d8)Synchronized the stack with main
1266a119a7606124f7f6c367a78d9b2e191eddf6using signed-off merge commits. Main already contains the mini-SWE dependency/runtime isolation fixes in #4733 and #4735 for the required shard-2 failure observed on #4711. The approved documentation is byte-for-byte unchanged from the preceding source commit, and the diff against the updated stack base remains documentation-only.Validation on this synchronized tree:
tests/unit_tests/test_fern_docs_links.py: 24 passed, 21 subtests passed.npm run checkinfern/: 0 errors, 1 warning.pre-commit run --all-files: all applicable hooks passed.git diff --check: passed; no runtime changes relative to the updated base.Final diff
681fd6573:pre-commit run --all-files: all applicable hooks passed.python -m pytest tests/unit_tests/test_fern_docs_links.py: 24 passed.fern check --warningswith a cached Fern CLI: 0 errors, 1 warning (redirect validation is skipped without Fern authentication).After the review fixes (
2d2d8f053, which also merges the updated #4712 branch; the guide'scleanup_timeout_secondsand pairing-flag fixes are applied to the moved walkthrough, which still matches the guide text):python -m pytest tests/unit_tests/test_fern_docs_links.py: 24 passed.pre-commit run --fileson the four pages: passed.fern checkand the Mermaid render (the flowchart is unchanged).Not done: a full-page Fern preview. Please check the catalog table against the READMEs, since it summarizes them by hand.
Rollouts
N/A: documentation only; no runtime behavior changed.
Compatibility and benchmark impact
None at runtime. Page URLs are unchanged. Two headings that exist on main are removed ("Agent session hooks" on Integrate Existing Agents and "Existing Agents" on Configure Agents); nothing on main links to their anchors.
Checklist
pre-commit run --all-files) (so CI lint/format checks pass).git commit -s) (so the DCO check passes).🤖 Generated with Claude Code