feat(agent): opt-in stall retry lane for local models (HERMES_STALL_RETRY_MODEL) - #37166
Closed
OmarB97 wants to merge 14 commits into
Closed
feat(agent): opt-in stall retry lane for local models (HERMES_STALL_RETRY_MODEL)#37166OmarB97 wants to merge 14 commits into
OmarB97 wants to merge 14 commits into
Conversation
dflash (Qwen3.6-27B Q4_K_M, lucebox spec-decode) sometimes ends an agentic
decision turn with EOS right after a short action preamble ("Let me check
X:") and NO tool_call, stalling the loop. Higher-precision weights (the
stock qwen3.6-27b-256k lane on the same host) continue to a real tool call
on the identical prompt.
This adds agent/stall_retry.py: when a no-tool-call turn looks like that
stall (short, announces an action, not a genuine completion) and
HERMES_STALL_RETRY_MODEL is set, re-issue the SAME turn once on that lane;
if it yields tool calls, adopt it and continue. Same provider/endpoint so
only the model name is overridden (no client rebuild). Fires at most once
per conversation. No-op unless the env is set, so default behavior is
unchanged.
Validated: detector 17/17 on real captured stall contents, 0 false
positives on genuine completions; live retry recovered real stalls into
real tool calls (terminal/execute_code) against the live endpoint; runs
correctly under `hermes -z` (probe-confirmed, env propagated).
This was referenced Jun 2, 2026
OmarB97
marked this pull request as ready for review
June 2, 2026 03:26
This was referenced Jun 9, 2026
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…lure returns The stall-retry lane added three run_conversation failure returns (stall_retry_limit_exhausted, stall_retry_failed_no_tool_call, stall_retry_exception) with "final_response": None, tripping the test_run_conversation_dict_returns_include_final_response guard that forbids literal-None final_response on dict returns. Hoist each block's error text into a local message var and set final_response to it, matching the sibling convention where final_response == error (actionable text the caller/UI can surface instead of an empty final response). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
|
Thanks for isolating the retry work and supplying focused coverage. This automated hermes-sweeper review is closing it under the repository's configuration policy.
The implementation effort and focused test coverage are appreciated. Closed as not-planned per standing maintainer policy ( |
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.
Why
PR #35642 currently mixes the stall-retry policy stack with local TTFB failover, backend recovery scripts, canary tooling, and unrelated TUI test changes. Reviewers need the dflash stall-retry behavior isolated to the files that actually implement and test the retry policy.
What changed
upstream/mainwith onlyagent/stall_retry.py,agent/conversation_loop.py, andtests/agent/test_stall_retry.py.How to review
Review
agent/stall_retry.pyfirst for the detection/config/promotion rules, thenagent/conversation_loop.pyfor the integration order, thentests/agent/test_stall_retry.pyfor the captured dflash regressions and cap behavior. This draft is intentionally a replacement slice for #35642, not a merge-ready claim that #35620/#35638 have landed.Evidence
git -c core.fsmonitor=false diff --name-only upstream/main..HEADlists onlyagent/conversation_loop.py,agent/stall_retry.py, andtests/agent/test_stall_retry.py.scripts/run_tests.sh tests/agent/test_stall_retry.py-> 35 tests passed, 0 failed.python3 -m py_compile agent/stall_retry.py agent/conversation_loop.py tests/agent/test_stall_retry.py-> rc=0.git -c core.fsmonitor=false diff --check upstream/main..HEAD-> rc=0.Verification
scripts/run_tests.sh tests/agent/test_stall_retry.py-> 35 passed.python3 -m py_compile agent/stall_retry.py agent/conversation_loop.py tests/agent/test_stall_retry.py-> passed.git -c core.fsmonitor=false diff --check upstream/main..HEAD-> passed.Risks / gaps
Medium risk because this changes agent retry behavior for configured dflash/local retry lanes. Remaining honest recovery-versus-regression evidence is explicitly tracked by MeshBoard parent task
hermes-stall-retry-multiple-per-turnand split taskhermes-pr35642-split-snowball-20260602; this PR only makes the code slice reviewable. Related non-policy slices are tracked separately: #37160 for canary tooling and #37163 for the TUI status assertion.Collaborators
Participants:
ko-mac.ko-mac, taskhermes-pr35642-split-snowball-20260602.Process:
upstream/main, cherry-picked only the stall-retry lineage and repeated-retry tail commits, then ran focused verification.Context:
hermes-pr35642-split-snowball-20260602.hermes-stall-retry-multiple-per-turn.Timing: