Skip to content

feat: run Hermes inside task sandboxes - #3489

Closed
ananthsub wants to merge 19 commits into
ananthsub/episode-orchestration-07-swe-pro-sessionsfrom
ananthsub/episode-orchestration-08-hermes-sandbox-execution
Closed

ananthsub wants to merge 19 commits into
ananthsub/episode-orchestration-07-swe-pro-sessionsfrom
ananthsub/episode-orchestration-08-hermes-sandbox-execution

Conversation

@ananthsub

@ananthsub ananthsub commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Runs Hermes in a task-owned sandbox when Resources supplies access, or creates an agent-owned sandbox from its configured provider and spec when access is absent. Both paths return sandbox-captured model/tool observations during close. Toolsets remain Agent Server configuration; sandbox execution does not force a SWE-specific terminal-only policy.

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 result
Loading

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 10 of 13 in the Environment Server stack. Previous: #3488. Next: #3490.

Validation

  • responses_api_agents/hermes_agent/.venv/bin/pytest responses_api_agents/hermes_agent/tests/ -q

Rollouts

See the final PR for end-to-end rollout evidence.

Compatibility and benchmark impact

Host-side Hermes behavior remains available outside native sessions.

@copy-pr-bot

copy-pr-bot Bot commented Sep 17, 2026

Copy link
Copy Markdown

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.

@ananthsub
ananthsub added this pull request to stack #3493 September 17, 2026 16:31
@ananthsub ananthsub changed the title ananthsub/episode orchestration 08 hermes sandbox execution feat: run Hermes inside task sandboxes Sep 17, 2026
@ananthsub
ananthsub force-pushed the ananthsub/episode-orchestration-08-hermes-sandbox-execution branch from 8dbf057 to cedee93 Compare September 17, 2026 20:17
@ananthsub
ananthsub force-pushed the ananthsub/episode-orchestration-08-hermes-sandbox-execution branch from cedee93 to f011343 Compare September 17, 2026 20:28
@ananthsub
ananthsub force-pushed the ananthsub/episode-orchestration-08-hermes-sandbox-execution branch 2 times, most recently from 171b6ca to 60862b0 Compare September 18, 2026 01:06
@ananthsub
ananthsub force-pushed the ananthsub/episode-orchestration-08-hermes-sandbox-execution branch from 60862b0 to 0d1d4d2 Compare September 18, 2026 01:32
@ananthsub
ananthsub marked this pull request as ready for review September 18, 2026 19:45
@nemo-automation-bot
nemo-automation-bot Bot requested review from a team September 18, 2026 19:46
@yaoyu-33 yaoyu-33 added complexity:high Cross-component or shared-contract change with a large review surface feature New capabilities, enhancements, or enablement work needs-review PR is ready for code review and waiting on a reviewer labels Sep 18, 2026
_SANDBOX_RUNNER = f"{_SANDBOX_RUNTIME_DIR}/sandbox_runner.py"
_SANDBOX_OBSERVER = f"{_SANDBOX_RUNTIME_DIR}/sandbox_observer.py"
_HERMES_REQUIREMENT = (
"hermes-agent @ https://github.com/cmunley1/hermes-agent/archive/26bb847a88493342ca1b194e0455b479073ae21d.tar.gz"

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.

Would be good to have single source of truth for the version. It's independently defined here and in requirements + hard-coded in sandbox runtime dir name

metadata:
benchmark: swebench-pro
config_paths:
- resources_servers/swebench_pro/configs/swebench_pro_resources_server.yaml

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.

There's no such file. Did you forget to commit?

if body.sandbox_access is None:
raise ValueError("Hermes requires sandbox_access for an episode session")
if self.config.enabled_toolsets != ["terminal"]:
raise ValueError("Hermes sandbox access requires enabled_toolsets: [terminal]")

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.

This is for testing-purposes only, right? The ultimate goal is to have general-purpose hermes server?

ananthsub and others added 19 commits September 28, 2026 07:44
Signed-off-by: Marta Stepniewska-Dziubinska <[email protected]>
Environment servers now answer /aggregate_metrics, so rollout collection has one
place to ask rather than reaching past them to an agent.

The base server registers the route and declares the method abstract, so every
protocol states where its metrics come from. single_agent forwards to the
resources server that verified; legacy_agent forwards to the agent it fronts.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Signed-off-by: Marta Stepniewska-Dziubinska <[email protected]>
Collection posted /run and /aggregate_metrics straight to the agent. Both now go
to the environment server declared for that agent, so nothing reaches an agent
without passing through one.

Resolving the server from the agent only describes an episode that has exactly
one. Routing should name the server directly once tasksets can.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Signed-off-by: Marta Stepniewska-Dziubinska <[email protected]>
Signed-off-by: Marta Stepniewska-Dziubinska <[email protected]>
The base declares four limits every environment server must state. A relay
enforces none of them, so configs had to repeat values that did nothing.

They now carry defaults, and setting one warns.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Signed-off-by: Marta Stepniewska-Dziubinska <[email protected]>
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Signed-off-by: Marta Stepniewska-Dziubinska <[email protected]>
Signed-off-by: Marta Stepniewska-Dziubinska <[email protected]>
Declares a legacy-agent environment server beside every bound agent instance.
Idempotent, with a --check mode.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Signed-off-by: Marta Stepniewska-Dziubinska <[email protected]>
Signed-off-by: Marta Stepniewska-Dziubinska <[email protected]>
Signed-off-by: Marta Stepniewska-Dziubinska <[email protected]>
…o entrypoint

Signed-off-by: Marta Stepniewska-Dziubinska <[email protected]>
Benchmarks that landed after the last sweep declare an agent with no environment
server, which rollout collection cannot reach.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Signed-off-by: Marta Stepniewska-Dziubinska <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Marta Stepniewska-Dziubinska <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Marta Stepniewska-Dziubinska <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Marta Stepniewska-Dziubinska <[email protected]>
…an environment server

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Marta Stepniewska-Dziubinska <[email protected]>
Signed-off-by: Ananth Subramaniam <[email protected]>
@ananthsub

Copy link
Copy Markdown
Contributor Author

Closing only to rebuild the dependency order: legacy compatibility support must merge first. The replacement Hermes PR will target #3714 and preserve this branch history.

This branch was previously deployed

1 inactive deployment
public — 86f6424f Deployed Sep 28, 2026 by copy-pr-bot[bot] via release / finalize / notify #3714
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:high Cross-component or shared-contract change with a large review surface feature New capabilities, enhancements, or enablement work needs-review PR is ready for code review and waiting on a reviewer sla:review-overdue Review response is over the one-business-day SLA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants