# NousResearch/hermes-agent · Refund iteration budget on API error for fallback chain

## Open now

- Nothing open on GitHub.

These issues and PRs address a bug where API call errors incorrectly consume the subagent iteration budget, leaving the fallback chain with insufficient iterations. The proposed fix refunds the budget when a fallback activates after an API error.

## TL;DR

- 5 member(s): 0 open issue(s), 1 closed issue(s), 0 open PR(s), 1 merged PR(s), 3 PR(s) closed without merging.
- A fix was merged to main in PR #121543. Verify it addresses your case.
- **Recommended:** read PR #121543 (and any competing PRs below) before filing. Confirm the merged change covers your symptom.

## Maintainer resolution verdict

- Internal-tracker verdict over this cluster's issue members: `resolved` · deciding PR(s): `pr-121543`. 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.40`: 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.

## Closed / duplicate issues

- #77305: fix(delegation): failed API calls consume the subagent iteration budget, starving the fallback chain

## Prior & competing PRs

- **#121543: fix(agent): truncation retries grow the output budget (clamped to model limit); tools-available continuation; refund fallback call**. merged to main · fix tier `verified`
  - maintainer direction: category `merged`; implication `superseded`
  - files: `agent/context_compressor.py`, `agent/conversation_loop.py`, `agent/turn_context_compaction.py`, `agent/turn_empty_response.py`, `agent/turn_final_response.py`, `agent/turn_iteration_prep.py`, `agent/turn_truncation.py`, `tests/agent/test_empty_response_fallback_refund.py`, `tests/agent/test_partial_stream_continuation_prompt.py`, `tests/agent/test_run_agent.py`, `tests/agent/test_truncated_tool_call_boost.py`
- **#77354: fix(agent): refund iteration budget when fallback activates after API failure (#77305)**. closed without merge
  - maintainer direction: category `implemented_elsewhere`; implication `superseded`; refs `3ac22a309b`, `#77305`, `#121543`
- **#78275: fix(agent): refund iteration budget on API failure so fallback chain gets fair chance (#77305)**. closed without merge
  - maintainer direction: category `implemented_elsewhere`; implication `superseded`; refs `#77305`
- **#88867: fix(agent): roll back both iteration gates on empty-response fallback (#77305)**. closed without merge
  - maintainer direction: category `uncategorized`; implication `needs_llm`; refs `3ac22a309b`, `#121543`, `#77305`

## Fix status

- Merged to main in PR #121543 (cited above). No release data is tracked. Verify downstream.
- Fix last verified (merged) `2026-09-24`.
- Subsystem: `agent`
