Skip to content

feat(agent): dflash stall-retry on a higher-quality lane - #28

Merged
OmarB97 merged 1 commit into
mainfrom
chore/dflash-stall-retry-on-main
May 31, 2026
Merged

feat(agent): dflash stall-retry on a higher-quality lane#28
OmarB97 merged 1 commit into
mainfrom
chore/dflash-stall-retry-on-main

Conversation

@OmarB97

@OmarB97 OmarB97 commented May 31, 2026

Copy link
Copy Markdown
Owner

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) and HERMES_STALL_RETRY_MODEL is 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-256k lane on the same host) continue to a real tool call on the identical prompt; retrying that one turn there recovers it.

Validated

  • Detector: 17/17 real captured stall contents classified as stalls, 0 false-positives on genuine completions ("Nothing to save.").
  • Live: retry_on_stall recovered real stalls into real tool calls (terminal, execute_code) against the live endpoint; probe-confirmed the integration runs under hermes -z with the env propagating.
  • Live agentic sessions drove tasks to completion (30/31 and 21/22 tool calls).

Enabled in the operator's install via ~/.hermes/.env (HERMES_STALL_RETRY_MODEL=qwen3.6-27b-256k).

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).
@github-actions

Copy link
Copy Markdown

🔎 Lint report: chore/dflash-stall-retry-on-main 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: 9524 on HEAD, 9524 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 4945 pre-existing issues carried over.

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

@OmarB97
OmarB97 merged commit f9d85fe into main May 31, 2026
21 of 22 checks passed
@OmarB97
OmarB97 deleted the chore/dflash-stall-retry-on-main branch May 31, 2026 00:50
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