fix: clarify interrupt re-queue label, document busy_input_mode behaviour
The '📨 Queued:' label was misleading — it looked like the message was silently deferred when it was actually being sent immediately after the interrupt. Changed to '⚡ Sending after interrupt:' with multi-message count when the user typed several messages during agent execution. Added comment documenting that this code path only applies when busy_input_mode == 'interrupt' (the default). Based on PR #4821 by iRonin. Co-authored-by: iRonin <iRonin@users.noreply.github.com>
This commit is contained in:
14
cli.py
14
cli.py
@@ -6266,8 +6266,11 @@ class HermesCLI:
|
|||||||
).start()
|
).start()
|
||||||
|
|
||||||
|
|
||||||
# Combine all interrupt messages (user may have typed multiple while waiting)
|
# Re-queue the interrupt message (and any that arrived while we were
|
||||||
# and re-queue as one prompt for process_loop
|
# processing the first) as the next prompt for process_loop.
|
||||||
|
# Only reached when busy_input_mode == "interrupt" (the default).
|
||||||
|
# In "queue" mode Enter routes directly to _pending_input so this
|
||||||
|
# block is never hit.
|
||||||
if pending_message and hasattr(self, '_pending_input'):
|
if pending_message and hasattr(self, '_pending_input'):
|
||||||
all_parts = [pending_message]
|
all_parts = [pending_message]
|
||||||
while not self._interrupt_queue.empty():
|
while not self._interrupt_queue.empty():
|
||||||
@@ -6278,7 +6281,12 @@ class HermesCLI:
|
|||||||
except queue.Empty:
|
except queue.Empty:
|
||||||
break
|
break
|
||||||
combined = "\n".join(all_parts)
|
combined = "\n".join(all_parts)
|
||||||
print(f"\n📨 Queued: '{combined[:50]}{'...' if len(combined) > 50 else ''}'")
|
n = len(all_parts)
|
||||||
|
preview = combined[:50] + ("..." if len(combined) > 50 else "")
|
||||||
|
if n > 1:
|
||||||
|
print(f"\n⚡ Sending {n} messages after interrupt: '{preview}'")
|
||||||
|
else:
|
||||||
|
print(f"\n⚡ Sending after interrupt: '{preview}'")
|
||||||
self._pending_input.put(combined)
|
self._pending_input.put(combined)
|
||||||
|
|
||||||
return response
|
return response
|
||||||
|
|||||||
Reference in New Issue
Block a user