feat(agent): dflash stall-retry on a higher-quality lane - #28
Merged
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).
🔎 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.
What
Adds the dflash agentic stall-retry to
main(cherry-picked clean onto current main, so only the 2 Fix B files change — main's other history is untouched).agent/stall_retry.py(new) —looks_like_stall()+retry_on_stall().agent/conversation_loop.py— at the no-tool-call turn-end, if the turn looks like a premature stall (announces an action, isn't a genuine completion) andHERMES_STALL_RETRY_MODELis set, re-issue the SAME turn once on that higher-quality lane; if it yields tool calls, adopt and continue. Fires at most once per conversation. No-op unless the env var is set → zero behavior change by default.Why
dflash (Qwen3.6-27B Q4_K_M, lucebox spec-decode) sometimes emits EOS right after a short action preamble ("Let me check X:") with no tool_call, stalling the agent mid-task. Higher-precision weights (the stock
qwen3.6-27b-256klane on the same host) continue to a real tool call on the identical prompt; retrying that one turn there recovers it.Validated
retry_on_stallrecovered real stalls into real tool calls (terminal,execute_code) against the live endpoint; probe-confirmed the integration runs underhermes -zwith the env propagating.Enabled in the operator's install via
~/.hermes/.env(HERMES_STALL_RETRY_MODEL=qwen3.6-27b-256k).