# NousResearch/hermes-agent · Anthropic context overflow error detection and handling

## Open now

- Nothing open on GitHub.

These items address a bug where Anthropic's 'prompt is too long' 400 error was not recognized as a context length error, causing aborts instead of compression, along with a related fix to prevent infinite loops and prompt injection via cache files.

## TL;DR

- 4 member(s): 0 open issue(s), 2 closed issue(s), 0 open PR(s), 1 merged PR(s), 1 PR(s) closed without merging.
- A fix was merged to main in PR #403. Verify it addresses your case.
- **Recommended:** read PR #403 (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: `partially_resolved` · deciding PR(s): `pr-403`. This is distinct from the fix status above. Weigh it yourself.

## How this cluster was grouped

- Link evidence (`STRUCTURAL_PARTIAL`): some members are connected by structural evidence (shared changed files, or a closing/superseded reference); the rest are joined by an automated relevance judgement over their text.
- Members outside that structural core may belong to a different underlying problem.
- Pairwise link density `0.39`: 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

- #348: Context overrun
- #813: Anthropic "prompt is too long" 400 error not detected as context length error — aborts instead of compressing

## Prior & competing PRs

- **#403: Fix context overrun crash with local LLM backends**. merged to main · fix tier `verified`
  - maintainer direction: category `merged`; implication `superseded`
  - files: `run_agent.py`
- **#821: fix(context): detect Anthropic 'prompt is too long' as context length error**. closed without merge · fix tier `suggested`
  - maintainer direction: category `implemented_elsewhere`; implication `superseded`
  - _suggested-tier fix detail withheld; re-request with `?tier=all` to include it._

## Fix status

- Merged to main in PR #403 (cited above). No release data is tracked. Verify downstream.
- Fix last verified (merged) `2026-03-05`. This confirmation is old and may be out of date (a revert/reopen would not have invalidated it here); re-verify.
- Subsystem: `agent`
