Skip to content

docs(agent): add harness onboarding and upgrade guide - #4712

Merged
yaoyu-33 merged 4 commits into
yaoyu-33/docs-architecture-environment-serverfrom
yaoyu-33/docs-harness-guide
Oct 20, 2026
Merged

yaoyu-33 merged 4 commits into
yaoyu-33/docs-architecture-environment-serverfrom
yaoyu-33/docs-harness-guide

Conversation

@yaoyu-33

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

Copy link
Copy Markdown
Contributor

What does this PR do?

Add "Add or Update a Harness", a contributor guide for integrating an agent harness that runs in a task sandbox, or upgrading one. It covers composing a benchmark and a harness independently, the episode lifecycle and sandbox lifetime policies, the Agent Server contracts, adapter configuration, a worked experiment with a Hermes to Pi swap and a SWE-bench Pro to Terminal Bench 2.1 swap, the agent_utils session helpers, input and error mapping, retry and close safety, and per-pairing validation.

The page starts from the guide in draft #3917 at 3955a976d and is updated for main after review (f915b745a): step 3 resolves the time budget with resolve_agent_timeout() and runs under the adapter's concurrency limit (#4653), the pairing flag goes only to gym eval run, the run.yaml example sets cleanup_timeout_seconds: 360 so Pi's close fits, the episode-timeout section notes that the benchmark sandbox's ttl_s is a separate limit, and the borrower snippet closes the provider when connect fails. Smaller corrections cover the OpenCode version pin, the Hermes 500 cases, the migration note, the SWE-bench Pro empty-patch path, and new requirements.txt and task_timeout.py rows. Its review history, including the comments that were addressed, is on #3917. It is split out so it can land after the architecture change and before the page restructure.

Stack: 1. architecture, 2. this PR, 3. restructure. This PR depends on #4711: the guide links to /main/about/architecture#environment-server, which that PR adds.

Tracks GYM-1011.

Validation

October 20 main sync (7ea31b8650a7310b1ec0a43c9a751ef07e98158b)

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 39476071868 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 ffbfe01f0:

  • 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).
  • All three Mermaid diagrams render with the Mermaid CLI.
  • Every internal link and heading anchor in the page resolves against this stack's page tree.
  • Re-check on main f4086444d: the six {Hermes, Pi, OpenCode} × {SWE-bench Pro, Terminal Bench 2.1} compositions built from the page's YAML blocks resolve with gym env resolve. The OpenCode agent block is adapted from the Pi one. No model or sandbox was launched.

After the review fixes (f915b745a, which also merges the updated #4711 branch):

  • python -m pytest tests/unit_tests/test_fern_docs_links.py: 24 passed.
  • pre-commit run --files on the guide: passed.
  • gym env resolve accepts the Hermes × SWE-bench Pro composition with cleanup_timeout_seconds: 360.
  • Not rerun: fern check and the Mermaid renders (the diagrams are unchanged).

Not done: a full-page Fern preview. The example commands were not run against a model or sandbox here; #3917 records its own offline validation.

Pairing check: only gym eval run checks the agent pairing, when it dispatches rollouts. gym eval prepare and gym env resolve do not check it and reject --allow-unsupported-pairing as an unknown argument, so the page now says to pass the flag only to gym eval run.

Rollouts

N/A: documentation only. Real model and task rollouts remain part of each harness implementation's validation.

Compatibility and benchmark impact

None. This adds a new page.

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

Add a contributor guide for integrating or updating an agent harness that
runs in a task sandbox: independent benchmark and agent composition, the
episode lifecycle and sandbox lifetime policies, the Agent Server contracts,
configuration, a worked experiment with a Hermes to Pi and a SWE-bench Pro
to Terminal Bench 2.1 swap, the agent_utils session helpers, input and error
mapping, retry and close safety, and per-pairing validation.

The page content is the guide from #3917 at 3955a97, unchanged. It is
split out so the architecture change and the agent-server page structure
can be reviewed separately.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Signed-off-by: yaoyu-33 <[email protected]>
@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 this pull request to stack #4714 October 17, 2026 15:49
@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 #4712 (docs only: new agent-server/add-or-update-a-harness.mdx, byte-identical to #3917 at 3955a976d).

Almost every technical claim matches main b3103ea8a: the agent session contract, SandboxSession, the supervisor client and process supervisor, uv_bootstrap, SandboxAccess, tool grants, Environment Server ordering, admission and cleanup timeouts, the benchmark sandbox lifecycles, the conformance CLIs, and the per-adapter details for Hermes, Pi, Codex, OpenCode, and OpenClaw. All six YAML blocks parse, and the four Hermes and Pi x SWE-bench Pro and Terminal Bench 2.1 compositions resolve with gym env resolve. All internal links and anchors resolve, including the #4711 anchors, and test_fern_docs_links.py and fern check pass. lafrancef's two #3917 fixes are present.

Your open question: only gym eval run checks the agent pairing, at dispatch; gym eval prepare and gym env resolve do not. See the comment on L466.

Stack notes

  • In this PR's tree, the existing remote-agent.mdx (L15-16) still says training pipelines "all work unchanged", which contradicts this guide's "no training". #4713 fixes it, so land the two together or move that line into this PR.
  • No page links to the new guide until #4713 adds the links that GYM-1011 asks for. It is still reachable through folder navigation.

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 6 agents (core-library expert, agent-harness expert, resources-server expert, bug finder, test agent, devil's advocate) plus a stack-wide comment reviewer.

Generated by Claude Code

<Warning>
The Terminal Bench 2.1 pairing with Hermes is experimental. The benchmark's `allowed_agents` list includes `pi_agent`, but does not include `hermes_agent`.

Before you try a pairing, review the benchmark's session and tool contract and the selected agent's task-image and runtime support. To run with Hermes, append `+allow_unsupported_pairing=true` to the prepare, resolve, and run commands; Pi does not require that override. Validate a representative rollout with a real model and verifier before you claim support. Do not remove the benchmark's guard, and do not mark the pairing as verified only because its configuration resolves.

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.

add-or-update-a-harness.mdx:466

[DOC] NOTE. This answers the question in the PR description: on this taskset path only gym eval run checks the pairing, at dispatch after the servers start (rollout_collection.py#L4255-L4297). gym eval prepare and gym env resolve accept Hermes x Terminal Bench 2.1 without the override, and gym env resolve rejects --allow-unsupported-pairing as an unknown argument (cli/main.py#L1086). Two smaller points: the override waives every allowed_agents and allowed_model_types check in the run (global_config.py#L1991-L1995), and "mark the pairing as verified" can be confused with the config's verified: flag, while the real declaration is allowed_agents. #4713 moves this sentence to integrate-existing-agents.mdx, where its new L27 already says the check runs when rollout collection starts.

Suggested change
Before you try a pairing, review the benchmark's session and tool contract and the selected agent's task-image and runtime support. To run with Hermes, append `+allow_unsupported_pairing=true` to the prepare, resolve, and run commands; Pi does not require that override. Validate a representative rollout with a real model and verifier before you claim support. Do not remove the benchmark's guard, and do not mark the pairing as verified only because its configuration resolves.
Before you try a pairing, review the benchmark's session and tool contract and the selected agent's task-image and runtime support. To run with Hermes, add `--allow-unsupported-pairing` to the `gym eval run` command; Pi does not require it. `gym eval prepare` and `gym env resolve` do not check the pairing, and `gym env resolve` rejects the flag; `gym eval run` checks the pairing only when it dispatches rollouts, after the servers start. The override waives every `allowed_agents` and `allowed_model_types` check in the run, not only this one. Validate a representative rollout with a real model and verifier before you claim support. Do not remove the benchmark's guard, and do not add the agent to the benchmark's `allowed_agents` only because its configuration resolves.

| `cleanup.json` | The supervisor records here whether the harness process group terminated. If a stop wins the launch claim, the stop shell writes the same receipt shape with `return_code: null` and `timed_out: false`. |
| `output.log` | The launch shell redirects supervisor and harness diagnostics here. Task output is a separate, adapter-owned artifact. |

When you migrate an adapter from an earlier `runner.py` or `sandbox/session.py` implementation, update the imports, hook arguments, control-file assumptions, test doubles, and tests together. These modules are imported at startup, even for host calls. Renamed helpers include `supervisor_command()`, now `supervised_launch_command()`, and `confirm_runner_cleanup()`, now `stop_and_confirm_cleanup()`.

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.

add-or-update-a-harness.mdx:676

[DOC] NOTE. runner.py, sandbox/session.py, supervisor_command(), and confirm_runner_cleanup() never existed on main or in a release; git log -S finds the helpers only on unmerged review branches. What main had before #3961 was nemo_gym/sandbox/process_supervisor.py, which #3961 moved to agent_utils. hermes_sandboxed_agent still launches the supervisor directly (app.py#L18, #L227-L236), and the page already names it.

Suggested change
When you migrate an adapter from an earlier `runner.py` or `sandbox/session.py` implementation, update the imports, hook arguments, control-file assumptions, test doubles, and tests together. These modules are imported at startup, even for host calls. Renamed helpers include `supervisor_command()`, now `supervised_launch_command()`, and `confirm_runner_cleanup()`, now `stop_and_confirm_cleanup()`.
When you migrate an adapter that launches the process supervisor itself, such as `hermes_sandboxed_agent`, or that was written before [#3961](https://github.com/NVIDIA-NeMo/Gym/pull/3961) moved `process_supervisor` from `nemo_gym.sandbox` to `nemo_gym.agent_utils`, move launch, termination, collection, and release into `SandboxSession`, and update the imports, hook arguments, control-file assumptions, test doubles, and tests together. These modules are imported at startup, even for host calls.

| Harness termination not confirmed | Fail the activation and skip verification. The sandbox owner tears the sandbox down. |
| Verification completed | Report the score, including valid zeros. |
| Verification missing or inconclusive | Report the missing measurement separately from scored attempts. |
| Verification infrastructure failure | Raise, or mask the sample with `mask_sample: true`. Do not report it as a reward of 0, and do not cache it as the session's verification result. Terminal Bench 2.1 and SWE-bench Pro do not follow this yet: they return a reward of 0 with `evaluation_completed: false`, and Terminal Bench 2.1 caches that result. Do not copy that behavior into a new Resources Server. |

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.

add-or-update-a-harness.mdx:759

[DOC] NOTE. SWE-bench Pro has a second path here. When patch extraction from the task sandbox fails, which is the .git/index.lock case L163 warns about, it grades an empty patch and returns reward 0 with evaluation_completed: true. The failure appears only in error (app.py#L507-L513, #L583-L596), and test_app.py#L188-L228 asserts it. A reader who filters on evaluation_completed would count these as real zeros.

Suggested change
| Verification infrastructure failure | Raise, or mask the sample with `mask_sample: true`. Do not report it as a reward of 0, and do not cache it as the session's verification result. Terminal Bench 2.1 and SWE-bench Pro do not follow this yet: they return a reward of 0 with `evaluation_completed: false`, and Terminal Bench 2.1 caches that result. Do not copy that behavior into a new Resources Server. |
| Verification infrastructure failure | Raise, or mask the sample with `mask_sample: true`. Do not report it as a reward of 0, and do not cache it as the session's verification result. Terminal Bench 2.1 and SWE-bench Pro do not follow this yet. When verification cannot run, both return a reward of 0 with `evaluation_completed: false`, and Terminal Bench 2.1 caches that result. When SWE-bench Pro cannot extract the patch from the task sandbox, it grades an empty patch and returns a reward of 0 with `evaluation_completed: true` and the extraction failure in `error`. Do not copy that behavior into a new Resources Server. |

| `model_server` | The Gym Model Server reference, for example `{type: responses_api_models, name: policy_model}`. The sandbox must be able to reach it. |
| `model` | The model name that the harness sends. |
| `num_workers` | Must be `1` for agent sessions. |
| Version pin | The exact harness version, for example `pi_version: 0.80.2` or `codex_version: 0.144.4`. Pi, Codex, OpenCode, and OpenClaw reject a missing or inexact version. Hermes has no version field; it pins `hermes-agent` in its `requirements.txt`. |

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.

add-or-update-a-harness.mdx:291

[DOC] NOTE. OpenCode does not reject a missing version: opencode_version defaults to the pinned OPENCODE_VERSION (opencode_agent/app.py#L180), and only an inexact value is rejected (#L626-L629). Pi, Codex, and OpenClaw do reject a missing version.

Suggested change
| Version pin | The exact harness version, for example `pi_version: 0.80.2` or `codex_version: 0.144.4`. Pi, Codex, OpenCode, and OpenClaw reject a missing or inexact version. Hermes has no version field; it pins `hermes-agent` in its `requirements.txt`. |
| Version pin | The exact harness version, for example `pi_version: 0.80.2` or `codex_version: 0.144.4`. Pi, Codex, and OpenClaw reject a missing or inexact version. OpenCode defaults `opencode_version` to its pinned release and rejects an inexact value. Hermes has no version field; it pins `hermes-agent` in its `requirements.txt`. |

Comment on lines +625 to +634
**3. Run one activation.** In the session branch of `responses()`, bind the request to a single shared task as described in [the session rules](#agent-server-and-environment-server). The task calls `execute()`:

```python
raw = await state.session.execute(
stage_activation=lambda: state.stage_activation(payload),
collect=state.collect,
timeout=self.config.timeout,
close_timeout=self.config.session_close_timeout_seconds,
)
```

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.

add-or-update-a-harness.mdx:625-634

[DOC] RISK. The guide is the #3917 snapshot from before #4653, so step 3 no longer matches the shared harness APIs, which is GYM-1011's done criterion. All five adapters pass resolve_agent_timeout(body.metadata, ceiling=...) (task_timeout.py#L14-L32; for example pi_agent/app.py#L691). Pi's strict validator exempts metadata.agent_timeout_sec (#L638), which Harbor rows carry. An adapter that follows this snippet and the "reject unsupported fields" advice at L734 reproduces the bug that #4653 fixed. The suggestion also names the session-lookup helpers: the base class checks cookies only on seed and close (base_responses_api_agent.py#L248-L266), so activation must call them itself. It also shows the concurrency semaphore that every adapter wraps around execute().

Suggested change
**3. Run one activation.** In the session branch of `responses()`, bind the request to a single shared task as described in [the session rules](#agent-server-and-environment-server). The task calls `execute()`:
```python
raw = await state.session.execute(
stage_activation=lambda: state.stage_activation(payload),
collect=state.collect,
timeout=self.config.timeout,
close_timeout=self.config.session_close_timeout_seconds,
)
```
**3. Run one activation.** In `responses()`, `self._agent_session_id_from_request(request)` returns the session ID from the cookie, or `None` for a sessionless host call. In the session branch, load the state with `self._require_agent_session(session_id)`, which returns HTTP 409 for an unknown, closing, or closed session, check the rollout path against `state.request.episode_id.capture_key`, and bind the request to a single shared task as described in [the session rules](#agent-server-and-environment-server). The task resolves the task's time budget and calls `execute()` under the adapter's `concurrency` limit:
```python
timeout = resolve_agent_timeout(body.metadata, ceiling=self.config.timeout)
async with self.sem: # asyncio.Semaphore(self.config.concurrency)
raw = await state.session.execute(
stage_activation=lambda: state.stage_activation(payload),
collect=state.collect,
timeout=timeout,
close_timeout=self.config.session_close_timeout_seconds,
)
```

| `agent_utils/supervisor_client.py` | Builds the launch and stop shell commands, defines control-file names and timeout budgets, validates termination receipts, and retires session directories safely. |
| `agent_utils/process_supervisor.py` | Runs inside the Linux sandbox using only the standard library. It enforces the harness deadline, stops and reaps the harness process group, and writes the termination receipt. The sandbox does not need a Gym installation. |
| `agent_utils/uv_bootstrap.py` | `uv_for_sandbox()` chooses the `uv` binary to upload for sandboxed Python runtime installation. It reuses a compatible host binary or downloads the static musl build for the detected platform. If the platform probe fails, it warns and falls back to the host binary without confirming compatibility. Hermes uses it. |
| `sandbox/utils.py` | `upload_text()` and `read_text()` transfer UTF-8 text through `AsyncSandbox.upload()` and `download()`. Use those underlying APIs directly for binary files. |

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.

add-or-update-a-harness.mdx:512

[DOC] RISK (same finding as L625-634). Add task_timeout.py to the shared-module table.

Suggested change
| `sandbox/utils.py` | `upload_text()` and `read_text()` transfer UTF-8 text through `AsyncSandbox.upload()` and `download()`. Use those underlying APIs directly for binary files. |
| `sandbox/utils.py` | `upload_text()` and `read_text()` transfer UTF-8 text through `AsyncSandbox.upload()` and `download()`. Use those underlying APIs directly for binary files. |
| `agent_utils/task_timeout.py` | `resolve_agent_timeout(metadata, ceiling=...)` returns the harness time budget: a task's positive `metadata.agent_timeout_sec`, which Harbor task rows carry, capped by the configured timeout. A missing or invalid value keeps the configured timeout. Hermes, Pi, Codex, OpenCode, and OpenClaw use it. |


### Map configuration and request fields explicitly

Handle each configuration and request field in one of three ways: apply it, reject it with a clear error, or document that the adapter ignores it by design. Never drop a field silently. For example, Pi rejects request fields that it does not support with HTTP 422, and Codex rejects `max_output_tokens`, `temperature`, `top_p`, and reasoning controls, because it cannot enforce them for a custom Gym provider.

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.

add-or-update-a-harness.mdx:734

[DOC] RISK (same finding as L625-634). The "reject what you do not support" example needs the one exception every strict adapter makes.

Suggested change
Handle each configuration and request field in one of three ways: apply it, reject it with a clear error, or document that the adapter ignores it by design. Never drop a field silently. For example, Pi rejects request fields that it does not support with HTTP 422, and Codex rejects `max_output_tokens`, `temperature`, `top_p`, and reasoning controls, because it cannot enforce them for a custom Gym provider.
Handle each configuration and request field in one of three ways: apply it, reject it with a clear error, or document that the adapter ignores it by design. Never drop a field silently. For example, Pi rejects request fields that it does not support with HTTP 422, but accepts `metadata.agent_timeout_sec`, which Harbor task rows carry, and applies it with `resolve_agent_timeout()`. Codex rejects `max_output_tokens`, `temperature`, `top_p`, and reasoning controls, because it cannot enforce them for a custom Gym provider.

| `sandbox.py` | A harness-specific session state class that composes `SandboxSession`. It installs the runtime at seed, stages input in `stage_activation()`, collects artifacts, and holds harness-specific state and diagnostics. |
| `sandbox_runner.py` | Reads the staged input, invokes the harness SDK or CLI, writes native output and optional process diagnostics, and keeps partial output where the harness supports it. Handles `SIGTERM` by stopping the harness and writing that partial output before it exits, because the supervisor sends `SIGTERM` at the deadline and on close. |
| `install_<harness>_runtime.sh` or an existing harness-specific installer | Installs the pinned harness and its private dependencies, then checks that they run. Keep installation out of the activation path. |
| `tests/` | Host dispatch, session setup, request semantics, output parsing, installation, and lifecycle regressions. |

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.

add-or-update-a-harness.mdx:502

[DOC] NOTE (also from #4653). The adapter's requirements.txt needs the sandbox extra; #4653 added it after fresh Pi, Codex, and OpenClaw venvs failed to import the OpenSandbox SDK at seed, which mocked session tests did not catch (pyproject.toml#L321).

Suggested change
| `tests/` | Host dispatch, session setup, request semantics, output parsing, installation, and lifecycle regressions. |
| `requirements.txt` | The adapter's isolated environment: `-e nemo-gym[dev,sandbox] @ ../../` plus packages that run on the Agent Server, such as a framework or SDK. Without the `sandbox` extra, the first sandbox session fails to import the provider SDK. |
| `tests/` | Host dispatch, session setup, request semantics, output parsing, installation, and lifecycle regressions. |

Comment on lines +391 to +394
max_concurrent_episodes: 1
queue_timeout_seconds: 60
# Above Hermes installation (900) + runner (21600) + SWE-bench Pro seed and verification (2700).
default_episode_timeout_seconds: 28800

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.

add-or-update-a-harness.mdx:391-394

[CONFIG] NOTE. The Pi swap keeps this run.yaml, but Pi's close takes up to 5 x 60 s plus a 60 s task wait (sandbox_session.py#L223-L286, pi_agent/sandbox.py#L59-L72), against the inherited cleanup_timeout_seconds: 180 (single_agent_turn.yaml#L16). This breaks the rule at L302, and a slow close fails the episode at cleanup without verification. Hermes, at 30 s, fits exactly. The comment's 2700 is SWE-bench Pro's verification_total_timeout only (swebench_pro.yaml#L16). This block resolves with gym env resolve.

Suggested change
max_concurrent_episodes: 1
queue_timeout_seconds: 60
# Above Hermes installation (900) + runner (21600) + SWE-bench Pro seed and verification (2700).
default_episode_timeout_seconds: 28800
max_concurrent_episodes: 1
queue_timeout_seconds: 60
# Above Hermes installation (900) + runner (21600) + SWE-bench Pro verification (2700), plus seed and agent close.
default_episode_timeout_seconds: 28800
# Per cleanup callback: 5 x session_close_timeout_seconds + the adapter's wait (Pi 5 x 60 + 60, Hermes 5 x 30 + 30).
cleanup_timeout_seconds: 360

@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
- Step 3 resolves the time budget with resolve_agent_timeout(), runs under
  the adapter's concurrency semaphore, and names the session lookup
  helpers; list agent_utils/task_timeout.py, and note that Pi accepts
  metadata.agent_timeout_sec (#4653).
- Pass --allow-unsupported-pairing only to gym eval run, which checks the
  pairing at dispatch; prepare and resolve do not accept it.
- Set cleanup_timeout_seconds: 360 in the run.yaml example so Pi's close
  fits, and note that the benchmark sandbox ttl_s is a separate limit.
- Close the provider when AsyncSandbox.connect() fails in the borrower
  snippet.
- Correct the OpenCode version pin, the Hermes 500 cases, the migration
  note, and the SWE-bench Pro empty-patch path; add the requirements.txt
  row with the sandbox extra.

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. Spot-checked the guide's code claims against main (resolve_agent_timeout, cleanup timeouts, sandbox extra, OpenCode version pin, session helpers) and they match. This should merge after #4711, since it links to the new #environment-server anchor.

@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 f915b74

@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 7ea31b8

@copy-pr-bot

copy-pr-bot Bot commented Oct 20, 2026

Copy link
Copy Markdown

/ok to test 7ea31b8

@yaoyu-33, there was an error processing your request: E2

See the following link for more information: https://docs.gha-runners.nvidia.com/cpr/e/2/

@yaoyu-33

Copy link
Copy Markdown
Contributor Author

/ok to test 7ea31b8

@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/39487973281

Merged via the queue into main with commit ca007dd Oct 20, 2026
40 of 45 checks passed
@yaoyu-33
yaoyu-33 deleted the yaoyu-33/docs-harness-guide branch October 20, 2026 20:09
yaoyu-33 added a commit to yaoyu-33/Gym that referenced this pull request Oct 21, 2026
… adapter

The harness onboarding guide (NVIDIA-NeMo#4712) landed after this branch last merged main
and cites `hermes_sandboxed_agent` twice as an example: once for bounding the
downloaded runner log, once as an adapter that launches the process supervisor
itself. This branch removes that adapter, so both examples would point at code
that no longer exists. Keep the guidance, including the 1 MiB tail bound, and
drop the reference.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: yaoyu-33 <[email protected]>

This branch was previously deployed

1 inactive deployment
public — 7ea31b86 Deployed Oct 20, 2026 by copy-pr-bot[bot] via release / finalize / notify #6045
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