Skip to content

fix(agent): optimize dflash stall recovery telemetry - #37

Merged
OmarB97 merged 1 commit into
mainfrom
fix/dflash-stall-telemetry-optimization
May 31, 2026
Merged

fix(agent): optimize dflash stall recovery telemetry#37
OmarB97 merged 1 commit into
mainfrom
fix/dflash-stall-telemetry-optimization

Conversation

@OmarB97

@OmarB97 OmarB97 commented May 31, 2026

Copy link
Copy Markdown
Owner

What changed

  • Enables the existing tool-use enforcement prompt for the local dflash model alias.
  • Adds bounded stall-retry telemetry with per-turn summaries and local NDJSON logging.
  • Adds a retry-only continuation nudge so the fallback lane is told to emit the promised tool call instead of repeating the preamble.
  • Keeps truly empty responses on the existing empty-response recovery path.
  • Makes low-information terminal redirects recoverable by default, with hard halt reserved for hard_stop_enabled.

Why

Recent dflash MeshBoard sessions mostly recovered, but still wasted turns on action-preamble stalls and repeated low-information terminal probes. One latest-run trace showed the new guardrail ending the turn too bluntly after repeated terminal probes; this patch turns that into recoverable tool feedback by default.

How to Review

Review agent/stall_retry.py and agent/conversation_loop.py for the retry and telemetry path, then review agent/tool_guardrails.py for the low-information terminal redirect change. The tests in tests/agent/test_stall_retry.py and tests/run_agent/test_tool_call_guardrail_runtime.py cover the new behavior directly.

Evidence

  • scripts/run_tests.sh tests/run_agent/test_run_agent.py tests/run_agent/test_tool_call_guardrail_runtime.py tests/agent/test_stall_retry.py tests/agent/test_tool_guardrails.py tests/agent/test_prompt_builder.py -- -q passed: 529 tests, 0 failed.
  • git diff --check passed with rc=0.
  • python -m py_compile agent/stall_retry.py agent/conversation_loop.py agent/prompt_builder.py agent/tool_guardrails.py hermes_cli/config.py passed with rc=0.

Verification

scripts/run_tests.sh tests/run_agent/test_run_agent.py tests/run_agent/test_tool_call_guardrail_runtime.py tests/agent/test_stall_retry.py tests/agent/test_tool_guardrails.py tests/agent/test_prompt_builder.py -- -q
git diff --check
python -m py_compile agent/stall_retry.py agent/conversation_loop.py agent/prompt_builder.py agent/tool_guardrails.py hermes_cli/config.py

Risks / Gaps

  • Telemetry is local bounded JSONL and omits raw request messages; low risk, no follow-up needed.
  • Upstream PR will be stacked on existing dflash retry PRs until Nous review lands; already tracked by the upstream mirror.

Collaborators

Participants: Omar, Codex.

Process: Reproduced from live Hermes/dflash MeshBoard traces, added focused regression coverage, then ran the broader main-loop tests.

Task context: MeshBoard task hermes-dflash-stall-optimization-pass.

Related work: Upstream mirror PR NousResearch#35694. Builds on fork PRs #28-#36 and the open upstream dflash retry stack.

@github-actions

Copy link
Copy Markdown

🔎 Lint report: fix/dflash-stall-telemetry-optimization 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: 9551 on HEAD, 9545 on base (🆕 +6)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 4959 pre-existing issues carried over.

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

@OmarB97
OmarB97 merged commit fc93cca into main May 31, 2026
22 checks passed
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