Skip to content

fix(agent): final_response contract — fork-pin the month-old verified fix + cover post-June drift - #253

Merged
OmarB97 merged 2 commits into
mainfrom
fix/final-response-fork-pin-20260704
Jul 4, 2026
Merged

fix(agent): final_response contract — fork-pin the month-old verified fix + cover post-June drift#253
OmarB97 merged 2 commits into
mainfrom
fix/final-response-fork-pin-20260704

Conversation

@OmarB97

@OmarB97 OmarB97 commented Jul 4, 2026

Copy link
Copy Markdown
Owner

The fleet's #1 local-lane fault (hermes -z: no final response was produced → exit 1 → hermes_exited_with_stderr, ~10/day, 20× today on the ko-taro lanes alone) has had a verified fix since June 5 — commit 93326ec339 on fix/final-response-contract-upstream-main-20260604, upstream as NousResearch#39345 — which stayed maintainer-gated for a month while our lanes kept dying. This PR routes around the wait by landing it on fork main (the checkouts every device runs from).

What's here

  • Cherry-pick 93326ec339: converts all 8 final_response: None partial-failure returns in run_conversation to diagnostic strings, plus the structural AST test that enforces the contract on every dict return.
  • Drift coverage (58e17025d8): main grew 7 more dict returns since June with no final_response key at all (invalid-API-retry exhaustion, context-overflow with compaction disabled, 413/context compression-exhaustion paths). Same fault class — PR fix(chat): guard final_response so empty runs fail cleanly, not KeyError #251's or "" guard turns a missing key into an empty string, which still trips oneshot.py:217 → exit 1. Each now carries a diagnostic final_response mirroring its error text.

Verification

  • tests/run_agent/test_run_agent.py: 386/386 pass (venv python, 98s), including the new structural test test_run_conversation_dict_returns_include_final_response (fails on current main — 7 missing-key paths).
  • grep -c '"final_response": None' agent/conversation_loop.py0 (was 8).
  • Rollback: single-file revert; prior known-good baseline 43fcf7ea6e.

Deploy after merge: git fetch origin && git reset --hard origin/main in ~/.hermes/hermes-agent on ko-mac / ko-taro / ko-win11 (hermes runs as per-dispatch oneshot — no daemon restart needed).

🤖 Generated with Claude Code

Omar Baradei and others added 2 commits July 4, 2026 11:40
…flagged

The cherry-picked 93326ec fixed the eight final_response:None returns
that existed in June. Main has since grown seven more dict returns in
run_conversation with no final_response key at all (invalid-API-retry
exhaustion, context-overflow with compaction disabled, 413/context
compression exhaustion paths) — same fault class, same oneshot exit-1
outcome. Give each the fix's idiom: a diagnostic final_response
mirroring the error text. The structural AST test now passes: no dict
return misses the key, none is literal None.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@OmarB97
OmarB97 merged commit 74d1e54 into main Jul 4, 2026
28 checks passed
@OmarB97
OmarB97 deleted the fix/final-response-fork-pin-20260704 branch July 4, 2026 18:48
@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown

🔎 Lint report: fix/final-response-fork-pin-20260704 vs origin/main

ruff

Total: 0 on HEAD, 0 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 0 pre-existing issues carried over.

ty (type checker)

Total: 10906 on HEAD, 10906 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 5711 pre-existing issues carried over.

Diagnostics are surfaced as warnings — this check never fails the build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant