Skip to content

refactor(hermes): remove standalone sandboxed agent - #3966

Open
yaoyu-33 wants to merge 31 commits into
NVIDIA-NeMo:mainfrom
yaoyu-33:codex/remove-hermes-sandboxed-agent
Open

yaoyu-33 wants to merge 31 commits into
NVIDIA-NeMo:mainfrom
yaoyu-33:codex/remove-hermes-sandboxed-agent

Conversation

@yaoyu-33

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

Copy link
Copy Markdown
Contributor

Hermes now runs in task sandboxes through EnvironmentServer sessions (#3720, hardened in #3554). Remove the separate hermes_sandboxed_agent implementation introduced by #3542, including its runner, runtime preparation scripts, configs, and adapter-specific tests. SWE-Pro advertises the retained hermes_agent, and its launch documentation points to the existing native recipe.

This is a focused follow-up to those merged PRs; a separate issue is unnecessary.

Migration and compatibility

  • This removes the old component/config paths; it is not an alias or a transparent /run replacement. Use benchmarks/swebench/pro/hermes.yaml and route collection through its EnvironmentServer. Existing prepared rows remain usable through single_agent_turn_legacy.
  • The SWE-Pro resources-server README provides a shared migration workflow for sandboxed harnesses (resources_servers/swebench_pro/README.md, "Migrate standalone sandboxed agents"): replacement capabilities, EnvironmentServer routing, sandbox ownership, configuration, and rollout validation. Hermes-specific obsolete keys, budgets, reporting fields, Apptainer settings, and runtime pins are documented in the Hermes README. Only the Hermes adapter is removed by this PR. The standalone /opt/hermes portable glibc/musl packaging is removed; existing offline and mixed-libc deployments need runtime preparation and validation before switching.
  • Shared sandbox providers, SWE-Pro verification, and the unified Hermes implementation are unchanged. Scores and failure coverage should be re-baselined after switching adapters because their runtime/settings/outcome contracts differ.

Validation

Python 3.13.14 on Linux, using existing component dependencies with package namespaces explicitly bound to the isolated source checkout: 447 passed.

python -m pytest responses_api_agents/hermes_agent/tests \
  resources_servers/swebench_pro/tests \
  environment_servers/single_agent_turn/tests \
  environment_servers/single_agent_turn_legacy/tests \
  tests/unit_tests/test_agent_sessions.py \
  tests/unit_tests/test_agent_session_retries.py \
  tests/unit_tests/test_apptainer_provider.py \
  tests/unit_tests/test_hermes_reasoning_replay.py \
  --import-mode=importlib -q -o addopts= -o log_cli=false --tb=short -rs
  • python -m pytest tests/unit_tests/test_fern_docs_links.py -q -o addopts='' -o log_cli=false: 18 passed, 17 subtests passed on macOS.
  • python -m pre_commit run --all-files and git diff --check: passed. Commit is DCO signed off.
  • cd fern && npm run check: 0 errors, 1 warning. The warning is that the remote missing-redirect check is skipped without Fern authentication.
  • Real-model HTTP smoke: EnvironmentServer → Hermes → OpenSandbox → SWE-Pro, using nvidia/nemotron-3-super-120b-a12b. Three model calls; inspected terminal actions locating and reading the target source. The 15-second runner limit yielded incomplete / stop_reason=wall_time, no patch, reward 0, mask_sample=false, and evaluation_completed=true, with 18 verifier outcomes (15 passed, 3 failed). Agent close preceded verification. Both sessions closed; no owned containers remained, and the temporary network was removed. This is lifecycle evidence, not an accuracy baseline. Detailed artifacts are retained privately.

Kept as a draft for migration review. No fresh Apptainer, Alpine/musl, offline-runtime, full-benchmark, full-repository, or per-server clean-venv validation is claimed; external Slurm deployment configs are not changed here.

@yaoyu-33 yaoyu-33 added the area:agent Agent harnesses and Responses API agent behavior label Oct 3, 2026
@copy-pr-bot

copy-pr-bot Bot commented Oct 3, 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 marked this pull request as ready for review October 3, 2026 20:40
@yaoyu-33 yaoyu-33 added complexity:medium Single-domain change with interacting parts or a moderate review surface feature New capabilities, enhancements, or enablement work needs-review PR is ready for code review and waiting on a reviewer labels Oct 3, 2026
@yaoyu-33

yaoyu-33 commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test db0c84f

@nemo-automation-bot
nemo-automation-bot Bot requested review from a team October 5, 2026 17:12
@github-actions

github-actions Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

@ananthsub

Copy link
Copy Markdown
Contributor

would be great for @j-nolan to take a look if not done already

@j-nolan

j-nolan commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

would be great for @j-nolan to take a look if not done already

I'll take a look tomorrow morning EMEA time 👍

@j-nolan

j-nolan commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Looks good overall! Before replacing the existing implementation, I’d recommend addressing the missing migration pieces you’ve documented in the description.

The most important one is Alpine/musl support. 88 SWE-Pro tasks rely on it. The existing implementation handles these. The new installer assumes the host’s uv can execute inside every task image. That fails for a glibc-linked uv on plain Alpine. I suggest establishing and validating a working installation path for them.

The new implementation also defaults to pinning Hermes from May 2026 (vs September 2026 in the existing one). Hermes has changed a lot since then, including its APIs.

Relatedly: the existing implementation's prepare_runtime.sh accepts a HERMES_VERSION and HERMES_REPO_URL variables, which are very convenient when comparing two variants of hermes, it would be nice to have the same mechanism here.

It's a significant migration, so I suggest doing a full swe-pro run to validate the new implementation, and check for infra/integration issues (score alone can hide them).

@j-nolan

j-nolan commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

@yaoyu-33 correction to my previous message: I realize your implementation won't have the alpine issue, so all good on this side, sorry for the churn!

yaoyu-33 and others added 3 commits October 9, 2026 07:17
The migration sections stated several settings and paths that do not match
the retained agent, so a reader following them would misconfigure the
replacement or fail to provision it.

- Split the removed settings into renamed/replaced and removed-with-no-
  counterpart. `cleanup_timeout` maps to the agent's own
  `session_close_timeout_seconds`, not to anything the Environment Server
  controls, and `chat_template_kwargs` maps to the narrower
  `chat_template_kwargs_enabled`. Record that `api_timeout` and
  `context_length` have no successor and what each one did, since both
  change behaviour rather than spelling.
- Warn that `--contain`/`--containall`, carried over from the removed
  `configs/apptainer.yaml`, replace the container's `/tmp` with a 64 MB
  session directory, which both starves the seed-time runtime install and
  hides a runtime baked into the image. Say to drop `default_binds`, which
  existed only for the removed `/opt/hermes` mount.
- State the pin's direction and repository: the standalone runtime tracked
  NousResearch at the September 2026 v0.21.1 release, while this agent pins
  the cmunley1 fork at a May 2026 commit. Note that `HERMES_VERSION` and
  `HERMES_REPO_URL` are no longer read.
- Give the literal runtime path: `<key>` is the first twelve characters of
  the pinned commit, not the full hash, and the preinstalled virtual
  environment must satisfy `python -c 'import run_agent, mcp'`. Mention the
  bundled static ripgrep the removed runtime provided for BusyBox images.
- Name the `max_turns` 90 to 30, `terminal_timeout` 180 to 60 and
  `concurrency` 4 to 32 changes that `benchmarks/swebench/pro/hermes.yaml`
  inherits, so migrators do not silently lose budget.
- Qualify the prepared-row claim: it holds for `prepare.py` output, but
  previously materialized inputs carry the removed agent's `agent_ref` and
  must be re-collated. Add that rows posted directly to `/run` need the
  rollout identity collection stamps on them.
- Record that failure records change from `agent_run_error` to
  `environment_server_failed`, that the per-request `max_output_tokens`
  budget is gone rather than renamed, and that SWE-Pro image provenance
  still reaches the rollout record.

Documentation only; no behaviour change.

Co-Authored-By: Claude Opus 5 <[email protected]>
Signed-off-by: yaoyu-33 <[email protected]>
Resolves three modify/delete conflicts in
`responses_api_agents/hermes_sandboxed_agent/` by keeping this branch's
deletion. Since the merge base, main changed that directory in four commits:

- NVIDIA-NeMo#3886 made the adapter a checkpoint participant, sending
  `CHECKPOINT_CLOSE_FOLLOWS_HEADER` on close.
- A hardening change added `MAX_OUTPUT_BYTES` and `_download_output_tail`,
  bounding harness output inside the sandbox before transfer.
- NVIDIA-NeMo#3902 and NVIDIA-NeMo#4470 made incidental edits.

Discarding that work is deliberate. The checkpoint participation it added is
not lost: NVIDIA-NeMo#3886 gave the same header to the environment servers, so
`environment_servers/single_agent_turn/app.py` already sends it on the session
path this branch migrates to. The output-bounding change applied only to the
removed runner; the retained agent reads its harness log through
`SandboxSession.read_output_log`, which is unbounded, so that gap is tracked
separately against the retained path rather than carried here.

No reference to the removed component survives outside the migration note in
`responses_api_agents/hermes_agent/README.md`, and nothing main added since
the merge base refers to it.

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

Copy link
Copy Markdown
Contributor Author

/ok to test 54db166

Follow NVIDIA-NeMo#5230's move of resolve_agent into
nemo_gym/data/tasks/harbor/prepare.py; the docstring edit carries over.

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

yaoyu-33 commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 2016f11

Resolve the harness-guide conflicts with NVIDIA-NeMo#5152 by taking its host-built
runtime text and dropping its notes that hermes_sandboxed_agent is being
deprecated, since this change removes the adapter. Update the Hermes
migration notes to match NVIDIA-NeMo#5152: the Agent Server builds and uploads the
runtime to /tmp/nemo-gym-hermes-runtime-<key>/python, so network-restricted
task images no longer need a preinstalled runtime.

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

yaoyu-33 commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 316e3d1

Keep the deletion of responses_api_agents/hermes_sandboxed_agent, including
the pyproject.toml and uv.lock that main's managed-environment change added
there. Point the hermes_agent migration notes at pyproject.toml and uv.lock,
which replaced requirements.txt, and drop a "Legacy" qualifier from a
swebench_pro test comment.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: yaoyu-33 <[email protected]>
@yaoyu-33
yaoyu-33 requested a review from a team as a code owner November 4, 2026 18:34
@yaoyu-33

yaoyu-33 commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test dad42ff

Resolve the harness-guide conflict with main's Codex runtime change
(NVIDIA-NeMo#5153): keep main's paragraph and drop its hermes_sandboxed_agent
deprecation sentence, since this branch removes that agent.

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

yaoyu-33 commented Nov 6, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test dce28c9

Resolve the integrate-existing-agents conflict by keeping main's task-folders
link and dropping hermes_sandboxed_agent from the deprecated list. Replace
the harbor-tasks example of an ambiguous --agent with terminus_2, since
`hermes` now resolves to hermes_agent alone. Update the Hermes migration
notes for main's context_length setting (NVIDIA-NeMo#5777): it keeps its name but sets
only model.context_length, where the removed adapter also set the
summarization auxiliary's window.

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

Copy link
Copy Markdown
Contributor Author

/ok to test 09312b1

Resolve the integrate-existing-agents conflict with main's mini-SWE
deprecation (NVIDIA-NeMo#5654): keep main's wording and its new mini_swe_agent
migration paragraph, and drop hermes_sandboxed_agent from the deprecated
list, since this branch removes that agent.

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

Copy link
Copy Markdown
Contributor Author

/ok to test 138afe5

Keep the deletion of responses_api_agents/hermes_sandboxed_agent/uv.lock,
which main's OpenAI 2.45 lock refresh (NVIDIA-NeMo#5464) modified.

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

Copy link
Copy Markdown
Contributor Author

/ok to test 5cea174

Keep the deletion of responses_api_agents/hermes_sandboxed_agent, whose
app.py and tests main's cached-token change (NVIDIA-NeMo#6127) modified.

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

Copy link
Copy Markdown
Contributor Author

/ok to test 658d09b

This branch had an error being deployed

1 failed (outdated) deployment
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 feature New capabilities, enhancements, or enablement work needs-review PR is ready for code review and waiting on a reviewer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants