# NousResearch/hermes-agent · Oneshot exit code fix for failures

## Open now

- 1 issue, 3 PRs open on GitHub.
- #74659: hermes -z (oneshot) exits 0 on HTTP 402 and on agent refusal — unattended callers read success
- PR #74708: fix(oneshot): return nonzero for unsuccessful runs
- PR #74777: fix(cli): oneshot exits non-zero on HTTP 402 and provider refusal (#74659)
- PR #104211: feat(oneshot): preserve structured terminal-failure facts in the usage report

These items address a bug where the oneshot/hermes -z mode incorrectly exits with code 0 on HTTP 402 errors and agent/provider refusals, causing unattended callers to misread failures as success.

## TL;DR

- 4 member(s): 1 open issue(s), 0 closed issue(s), 3 open PR(s), 0 merged PR(s), 0 PR(s) closed without merging.
- No fix has been merged to main; one or more PRs were attempted (see below).
- **Recommended:** review the prior/competing PR(s) below. A fix was attempted but not merged; your case may extend or revive that work.

## Maintainer resolution verdict

- Internal-tracker verdict over this cluster's issue members: `unresolved`. This is distinct from the fix status above. Weigh it yourself.

## How this cluster was grouped

- Link evidence (`STRUCTURAL_SPANNING`): every member is connected by structural evidence: shared changed files, or a closing/superseded reference.
- Pairwise link density `0.50`: the share of member pairs that carry a link, counting a structural link in full and a relevance-only link at 0.36. `1.00` means every pair is linked.

## Open related issues

- #74659: hermes -z (oneshot) exits 0 on HTTP 402 and on agent refusal — unattended callers read success

## Prior & competing PRs

- **#74708: fix(oneshot): return nonzero for unsuccessful runs**. open
  - maintainer direction: category `partial_fix`; implication `needs_llm`; refs `ae7e857420bde96875c4889c8332ba08e9bf5e82`
  - files: `hermes_cli/oneshot.py`, `tests/hermes_cli/test_oneshot_exit_status.py`, `tests/hermes_cli/test_oneshot_usage_file.py`, `website/docs/reference/cli-commands.md`
- **#74777: fix(cli): oneshot exits non-zero on HTTP 402 and provider refusal (#74659)**. open
  - maintainer direction: category `partial_fix`; implication `needs_llm`; refs `#74659`
  - files: `hermes_cli/oneshot.py`, `tests/hermes_cli/test_oneshot_exit_code.py`
- **#104211: feat(oneshot): preserve structured terminal-failure facts in the usage report**. open
  - maintainer direction: category `uncategorized`; implication `needs_llm`; refs `8136e2cffbff013a34b81ce8eaf97042828f2881`, `#74777`, `#92531`, `#74659`
  - files: `agent/codex_runtime.py`, `agent/conversation_loop.py`, `agent/turn_recovery.py`, `hermes_cli/oneshot.py`, `run_agent.py`, `tests/agent/test_turn_recovery_failure_facts.py`, `tests/hermes_cli/test_oneshot_usage_file.py`, `website/docs/reference/cli-commands.md`

## Fix status

- No merged fix on record.
- Subsystem: `hermes_cli`
