# NousResearch/hermes-agent · Fixing KeyError and crashes on run_conversation error paths

## Open now

- Nothing open on GitHub.

Multiple issues and fix attempts address KeyError on 'final_response' and crashes when run_conversation returns a non-dict, affecting AIAgent.chat(), main(), and the cron scheduler.

## TL;DR

- 10 member(s): 0 open issue(s), 2 closed issue(s), 0 open PR(s), 1 merged PR(s), 7 PR(s) closed without merging.
- A fix was merged to main in PR #14490. Verify it addresses your case.
- **Recommended:** read PR #14490 (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: `unresolved`. 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.19`: 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

- #9433: Cron scheduler crash: 'int' object has no attribute 'get' when agent.run_conversation returns non-dict
- #55822: AIAgent.chat() and main() raise KeyError('final_response') on run_conversation error/exhaustion paths

## Prior & competing PRs

- **#14490: fix(cron): guard against non-dict result from run_conversation (salvage #9437)**. merged to main · fix tier `verified`
  - maintainer direction: category `merged`; implication `superseded`
  - files: `cron/scheduler.py`, `scripts/release.py`
- **#55821: fix(agent): chat()/main() raise KeyError('final_response') on run_conversation error paths**. closed without merge · fix tier `suggested`
  - maintainer direction: category `implemented_elsewhere`; implication `superseded`; refs `053424c4865db0e8cc6ef9a8c2f49bf8882afd45`
  - _suggested-tier fix detail withheld; re-request with `?tier=all` to include it._
- **#55989: fix(agent): use .get() for final_response to prevent KeyError (#55822)**. closed without merge · fix tier `suggested`
  - maintainer direction: category `implemented_elsewhere`; implication `superseded`; refs `053424c4865db0e8cc6ef9a8c2f49bf8882afd45`
  - _suggested-tier fix detail withheld; re-request with `?tier=all` to include it._
- **#9437: fix(cron): guard against non-dict result from run_conversation**. closed without merge
  - maintainer direction: category `superseded_by_pr`; implication `superseded`; refs `#14490`
- **#9498: fix(cron): handle non-dict return from run_conversation in scheduler**. closed without merge
  - maintainer direction: category `stale_abandoned`; implication `active`
- **#9503: fix(cron): guard against non-dict conversation results**. closed without merge
  - maintainer direction: category `merged_via`; implication `superseded`; refs `22afa066f`, `#14490`, `#9437`, `#14490`, `#9433`
- **#55880: fix(agent): handle missing final_response on error paths**. closed without merge
  - maintainer direction: category `uncategorized`; implication `needs_llm`
- **#55891: fix: AIAgent.chat() and main() return empty string instead of raising KeyError on run_conversation error/exhaustion paths**. closed without merge
  - maintainer direction: category `implemented_elsewhere`; implication `superseded`; refs `053424c4865db0e8cc6ef9a8c2f49bf8882afd45`

## Fix status

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