Skip to content

fix(hermes_agent): return a process that ended without output instead of raising - #6939

Draft
giuliolovisotto wants to merge 2 commits into
glovisotto/tb41-hermes-nooa-profilesfrom
glovisotto/hermes-ended-without-output
Draft

giuliolovisotto wants to merge 2 commits into
glovisotto/tb41-hermes-nooa-profilesfrom
glovisotto/hermes-ended-without-output

Conversation

@giuliolovisotto

@giuliolovisotto giuliolovisotto commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

A sandboxed Hermes process that ends before it writes its output is now returned to the environment instead of raising: as a wall-time result when the supervisor stopped it at its deadline, and as a failed response with the cause agent_run_error when it was killed.

Why. collect_artifacts raised Hermes sandbox runner exited without output whatever ended the process. The environment server saw an HTTP error, so its agent_outcome_policy never saw the run, and rollout collection ran the task again from the start. Two cases were lost this way:

  • A process the supervisor had to kill at the deadline wrote no wall-time transcript. The same task and budget gave a verified wall-time stop when Hermes stopped on the first signal and a repeated run when it did not.
  • A process that was killed mid-run (for example by the memory cgroup's killer) was repeated as often as the run's budget allowed, a second chance that harnesses which return a died run for grading do not get.

What changes (responses_api_agents/hermes_agent/app.py): when the output capture failed and the supervisor's cleanup receipt is confirmed and carries no supervisor error,

  • timed_out: the run returns a wall-time result with no transcript (stop_reason: wall_time), an incomplete response that the environment verifies like any other wall-time stop;
  • an exit code above 128 (ended by a signal): the run returns a failed response whose ng_agent_outcome is agent_run_error. The shared agent_outcome_policy default fails that kind without grading or repeating it; a deployment maps it to verify or retry in agent_outcome_policy.by_failure_kind.
  • Unchanged: any other exit without output still raises, because the harness may never have started and returning it for grading would turn a broken setup into scored zeros. Provider failures and the existing TimeoutError path are unchanged. Host execution is unchanged.

An exit code is not evidence of an out-of-memory kill, so no provider_oom_killed is reported here.

benchmarks/terminal_bench_4/hermes.yaml maps agent_run_error to verify in the Harbor environment server's agent_outcome_policy, so a Hermes run that was killed is graded on the sandbox as it left it, as terminal_bench_4/opencode does with verify_after_agent_error and as terminal_bench_4/nooa does in the PR below this one.

No issue is linked.

Validation

  • uv sync in responses_api_agents/hermes_agent, then python -m pytest responses_api_agents/hermes_agent/tests -q -n 6: 424 passed, 6 skipped.
  • pre-commit run on the changed files: clean.
  • New tests (tests/test_app.py): a process killed before its output returns a failed response with agent_run_error, which the default policy fails and a verify mapping grades; a process stopped at its deadline before its output returns an incomplete wall-time response with no outcome metadata; a process that exited with code 1 before its output still raises.

Rollouts

Not yet. A small run on terminal_bench_4/hermes is planned; I will add its evidence here.

Compatibility and benchmark impact

Behavior change for sandboxed Hermes. A run killed before it wrote its output was an HTTP error that rollout collection repeated; it is now a classified failed response, which the default outcome policy fails without repeating. A deployment that wants the earlier behavior maps agent_run_error to retry. A run killed at its deadline is now verified as a wall-time stop, so scores of such runs can change. Configuration: terminal_bench_4/hermes grades a killed run instead of failing it.

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.
  • All commits have DCO sign-off (git commit -s) (so the DCO check passes).

🤖 Generated with Claude Code

@copy-pr-bot

copy-pr-bot Bot commented Nov 30, 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.

@giuliolovisotto
giuliolovisotto force-pushed the glovisotto/hermes-ended-without-output branch from 1ca02f7 to 67efdc0 Compare November 30, 2026 11:49
@giuliolovisotto
giuliolovisotto changed the base branch from glovisotto/hermes-task-tools to glovisotto/tb41-hermes-nooa-profiles November 30, 2026 11:49
@giuliolovisotto giuliolovisotto added bug Something isn't working area:agent Agent harnesses and Responses API agent behavior risk:mid Autobot PR risk: mid labels Nov 30, 2026
giuliolovisotto and others added 2 commits November 30, 2026 14:49
… of raising

A sandboxed Hermes process that ended before it wrote its output made the
agent server raise, whatever ended it. The environment server saw an HTTP
error, so its agent_outcome_policy never saw the run, and rollout collection
ran the task again from the start. A process the supervisor had to kill at
its deadline was repeated the same way instead of being graded as a
wall-time stop.

The agent server now reads the supervisor's cleanup receipt:

- stopped at its deadline: a wall-time result with no transcript, returned
  as an incomplete response and verified like any other wall-time stop;
- killed otherwise (an exit code above 128): a failed response with the
  cause agent_run_error, so the environment's outcome policy decides whether
  the task is graded, run again or failed.

Any other exit without output may be a harness that never started, and still
raises.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: Giulio Lovisotto <glovisotto@nvidia.com>
hermes_agent returns a process that was killed before it wrote its output as
a failed response with the cause agent_run_error. The Harbor environment
server's default agent_outcome_policy fails such a task without grading it.

terminal_bench_4/hermes maps agent_run_error to verify, so the sandbox is
graded as the run left it, as terminal_bench_4/opencode does with
verify_after_agent_error.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: Giulio Lovisotto <glovisotto@nvidia.com>
@giuliolovisotto
giuliolovisotto force-pushed the glovisotto/hermes-ended-without-output branch from 67efdc0 to 608d0ec Compare November 30, 2026 13:52

This branch has not been deployed

No deployments
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 bug Something isn't working risk:mid Autobot PR risk: mid

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant