Skip to content

docs(agent): organize agent-server pages by reader - #4713

Merged
yaoyu-33 merged 4 commits into
yaoyu-33/docs-harness-guidefrom
yaoyu-33/docs-agent-server-pages
Oct 20, 2026
Merged

yaoyu-33 merged 4 commits into
yaoyu-33/docs-harness-guidefrom
yaoyu-33/docs-agent-server-pages

Conversation

@yaoyu-33

@yaoyu-33 yaoyu-33 commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

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.

Page Reader Change
Configure Agents (index) Everyone Add "Choose a Path" (integrated agent, Remote Agent, adapter, custom Environment Server) and a score-to-training route. Add a note that most agents, including Remote Agent, still run their own episode behind a legacy_agent relay, and that a native Environment Server such as single_agent_turn orders seed and verify for agents with sessions.
Integrate Existing Agents Users of an integrated agent Add a catalog of the sandboxed harnesses, and point the older *_sandboxed_agent adapters to Compare Harnesses. Move the experiment and swap walkthrough here from the guide. Remove the agent session hooks section.
Drive a Remote Agent Users with an unsupported agent Say what Remote Agent gives and does not give. Stop saying that training works unchanged.
Add or Update a Harness Adapter authors Keep only adapter-author content and link to the moved sections.

Most content is moved, not rewritten:

  • The experiment and swap walkthrough moves verbatim from the guide to Integrate Existing Agents.
  • The path chooser moves from the guide to Configure Agents, with links made absolute. It gains an "Already integrated?" branch and an Integrate Existing Agents row, and the "What you build" column becomes "What you do".
  • The agent session hooks section is removed. The guide already states the session contract, setup failure, retained close, and termination rules. Two statements that existed only in the old section are added to the guide: the _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_agents lists in swebench_pro.yaml and terminal_bench_2_1.yaml on main b3103ea8a. Declared means the agent is in that list; it is not a validation. opencode_agent is 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_agent adapters that both lists also name (opencode_sandboxed_agent, hermes_sandboxed_agent, terminus_2_sandboxed_agent) run their own episode behind legacy_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-server and to the guide.

Tracks GYM-1011.

Validation

October 20 main sync (38d41fd788b17528d9da86467e717e255bb168d8)

Synchronized the stack with main 1266a119a7606124f7f6c367a78d9b2e191eddf6 using 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:

  • Source-bound tests/unit_tests/test_fern_docs_links.py: 24 passed, 21 subtests passed.
  • npm run check in fern/: 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.
  • Model rollouts: N/A for this documentation-only diff. No new upstream-runtime or model-smoke validation is claimed.
  • Fresh CICD run 39475765075 on this exact source: required Nemo_CICD_Test, Lint and DCO all passed. Fern check and docs preview passed. The actual classifier reports docs_only=true, so core/server tests were legitimately skipped. Optional conformance jobs have failures; this is required-check readiness, not an overall workflow-success claim.

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 --warnings with a cached Fern CLI: 0 errors, 1 warning (redirect validation is skipped without Fern authentication).
  • The new chooser flowchart renders with the Mermaid CLI.
  • All 44 internal links and heading anchors in the four pages resolve against the page tree.
  • Balanced code fences and Fern components in all four pages.

After the review fixes (2d2d8f053, which also merges the updated #4712 branch; the guide's cleanup_timeout_seconds and 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 --files on the four pages: passed.
  • Not rerun: fern check and 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

  • I have read the contributing guidelines.
  • The change is focused; unrelated "drive-by" edits are tracked as separate issues/PRs.
  • Tests added or updated and pass locally, or N/A for docs-only / non-code changes (so CI unit/server checks pass when applicable).
  • Documentation added or updated, or N/A with justification.
  • Pre-commit checks pass locally (pre-commit run --all-files) (so CI lint/format checks pass).
  • New source files include the required Apache-2.0 SPDX header (N/A: no source files).
  • All commits have DCO sign-off (git commit -s) (so the DCO check passes).

🤖 Generated with Claude Code

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
yaoyu-33 added this pull request to stack #4714 October 17, 2026 15:49
@copy-pr-bot

copy-pr-bot Bot commented Oct 17, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@yaoyu-33 yaoyu-33 added docs Documentation-only updates or documentation debt area:agent Agent harnesses and Responses API agent behavior labels Oct 17, 2026

@yaoyu-33 yaoyu-33 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 |

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
| 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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

index.mdx:48

[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.

Suggested change
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.

@yaoyu-33
yaoyu-33 marked this pull request as ready for review October 19, 2026 16:31
yaoyu-33 and others added 2 commits October 19, 2026 10:43
…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]>
@yaoyu-33 yaoyu-33 added complexity:medium Single-domain change with interacting parts or a moderate review surface needs-review PR is ready for code review and waiting on a reviewer labels Oct 19, 2026

@ffrujeri ffrujeri left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

This should merge after #4711 and #4712.

@yaoyu-33 yaoyu-33 added ready-to-merge PR is approved, current, and waiting for final CI or merge and removed needs-review PR is ready for code review and waiting on a reviewer labels Oct 20, 2026
@yaoyu-33

Copy link
Copy Markdown
Contributor Author

/ok to test 2d2d8f0

@github-actions

github-actions Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

@yaoyu-33

Copy link
Copy Markdown
Contributor Author

/ok to test 38d41fd

@yaoyu-33
yaoyu-33 added this pull request to the merge queue Oct 20, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/39488122365

Merged via the queue into main with commit c318f04 Oct 20, 2026
40 of 45 checks passed
@yaoyu-33
yaoyu-33 deleted the yaoyu-33/docs-agent-server-pages branch October 20, 2026 20:09
yaoyu-33 added a commit to yaoyu-33/Gym that referenced this pull request Oct 21, 2026
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]>

This branch was previously deployed

1 inactive deployment
public — 38d41fd7 Deployed Oct 20, 2026 by copy-pr-bot[bot] via release / finalize / notify #6044
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:agent Agent harnesses and Responses API agent behavior complexity:medium Single-domain change with interacting parts or a moderate review surface docs Documentation-only updates or documentation debt ready-to-merge PR is approved, current, and waiting for final CI or merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants