fix(agent): final_response contract — fork-pin the month-old verified fix + cover post-June drift - #253
Merged
Merged
Conversation
…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>
🔎 Lint report:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 — commit93326ec339onfix/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
93326ec339: converts all 8final_response: Nonepartial-failure returns inrun_conversationto diagnostic strings, plus the structural AST test that enforces the contract on every dict return.58e17025d8): main grew 7 more dict returns since June with nofinal_responsekey 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'sor ""guard turns a missing key into an empty string, which still tripsoneshot.py:217→ exit 1. Each now carries a diagnosticfinal_responsemirroring its error text.Verification
tests/run_agent/test_run_agent.py: 386/386 pass (venv python, 98s), including the new structural testtest_run_conversation_dict_returns_include_final_response(fails on current main — 7 missing-key paths).grep -c '"final_response": None' agent/conversation_loop.py→ 0 (was 8).43fcf7ea6e.Deploy after merge:
git fetch origin && git reset --hard origin/mainin~/.hermes/hermes-agenton ko-mac / ko-taro / ko-win11 (hermes runs as per-dispatch oneshot — no daemon restart needed).🤖 Generated with Claude Code