feat(agent): opt-in retry for no-tool-call stalls via HERMES_STALL_RETRY_MODEL - #35620
Closed
OmarB97 wants to merge 2 commits into
Closed
feat(agent): opt-in retry for no-tool-call stalls via HERMES_STALL_RETRY_MODEL#35620OmarB97 wants to merge 2 commits into
OmarB97 wants to merge 2 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).
OmarB97
marked this pull request as ready for review
May 31, 2026 01:37
This was referenced May 31, 2026
Contributor
Author
|
Closing in favor of #37166, which carries this same stall-retry stack (agent/stall_retry.py + conversation_loop integration + tests) in its complete form. Consolidating to one canonical PR so reviewers don't see three PRs creating the same module. |
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.
Summary
HERMES_STALL_RETRY_MODELpath for short no-tool-call action preambles from dflashRoot Cause
The dflash Q4 lane can stop after text like “Let me check ...” without emitting a tool call. Accepting that as a normal final response leaves the session with an assistant planning turn and makes later
continueprompts inherit poisoned history. The retry must either produce executable tool calls or fail the turn without saving the stalled assistant text.Validation
python3 -m pytest tests/agent/test_stall_retry.pypython3 -m py_compile agent/conversation_loop.py agent/stall_retry.py