hermes - 💡(How to fix) Fix CLI: completion_queue drain only runs on idle timeout, notify_on_complete notifications silently lost [1 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Root Cause

The drain logic was inside the except queue.Empty branch, meaning it only executed when no user input was pending. It should run on every loop iteration.

Fix Action

Fixed

RAW_BUFFERClick to expand / collapse

Bug Description

In cli.py process_loop(), the completion_queue drain only ran when _pending_input.get(timeout=0.1) timed out — i.e., when the agent was idle. When the user sent a message, the drain was skipped entirely. If a background process exited during the agent's turn, the completion event sat in the queue until the post-turn drain. However, if the agent called process(action='poll') during the turn, _completion_consumed was set (see #10156 for the regression), and the post-turn drain skipped the event with continue. The notification was permanently lost.

This is a compounding factor to #10156. Even if #10156 is fixed, the idle-only drain window still delays notifications and creates races with wait()/log().

Root Cause

The drain logic was inside the except queue.Empty branch, meaning it only executed when no user input was pending. It should run on every loop iteration.

Proposed Fix

Move the completion_queue drain to run on every loop iteration, before the _pending_input.get() call.

Related Issues

  • #10156 — _completion_consumed regression from PR #8228

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING