hermes - 💡(How to fix) Fix [Feature] Option to queue incoming messages instead of interrupting running tasks [1 comments, 1 participants]

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…
GitHub stats
NousResearch/hermes-agent#11633Fetched 2026-04-18 05:59:42
View on GitHub
Comments
1
Participants
1
Timeline
2
Reactions
0
Participants
Timeline (top)
closed ×1commented ×1

Currently, when the Hermes gateway agent is executing a task and the user sends a new message, the gateway immediately interrupts the running agent (aborting in-flight tool calls) and responds with "⚡ Interrupting current task (X min elapsed, iteration N/90, running: terminal). I'll respond to your message shortly."

This interrupt-then-restart pattern is destructive:

  • Long-running tasks (builds, deployments, multi-step operations) lose all progress
  • The agent re-processes the new message from scratch, often re-executing the same expensive commands
  • Creates a frustrating loop where the user sees repeated interruptions with no actual progress

Root Cause

Currently, when the Hermes gateway agent is executing a task and the user sends a new message, the gateway immediately interrupts the running agent (aborting in-flight tool calls) and responds with "⚡ Interrupting current task (X min elapsed, iteration N/90, running: terminal). I'll respond to your message shortly."

This interrupt-then-restart pattern is destructive:

  • Long-running tasks (builds, deployments, multi-step operations) lose all progress
  • The agent re-processes the new message from scratch, often re-executing the same expensive commands
  • Creates a frustrating loop where the user sees repeated interruptions with no actual progress

Code Example

gateway:
  message_queue_mode: queue  # "interrupt" (current default) | "queue"
  # or per-platform:
  feishu:
    message_queue_mode: queue
RAW_BUFFERClick to expand / collapse

Description

Currently, when the Hermes gateway agent is executing a task and the user sends a new message, the gateway immediately interrupts the running agent (aborting in-flight tool calls) and responds with "⚡ Interrupting current task (X min elapsed, iteration N/90, running: terminal). I'll respond to your message shortly."

This interrupt-then-restart pattern is destructive:

  • Long-running tasks (builds, deployments, multi-step operations) lose all progress
  • The agent re-processes the new message from scratch, often re-executing the same expensive commands
  • Creates a frustrating loop where the user sees repeated interruptions with no actual progress

Requested Behavior

Add a configurable option (per platform or global) to queue incoming messages instead of interrupting:

gateway:
  message_queue_mode: queue  # "interrupt" (current default) | "queue"
  # or per-platform:
  feishu:
    message_queue_mode: queue

When queue mode is enabled:

  1. New messages are silently queued (with a brief acknowledgment like "📋 Queued (position 1), I'll get to it after finishing the current task")
  2. The agent continues executing its current task uninterrupted
  3. Once the current task completes (or the agent loop exits), the queued messages are dequeued and processed in order
  4. No tool calls are aborted, no progress is lost

Use Case

Messaging platform users (Feishu, Telegram, Discord) frequently send follow-up messages while the agent is working — corrections, additional context, or unrelated questions. In most cases, these do not require immediate interruption of the current task. The user just wants the agent to handle them when it's done.

The current interrupt-only behavior is particularly harmful for:

  • Terminal commands with background=true or long timeouts
  • Multi-step workflows (build -> test -> deploy)
  • Tasks that have already consumed significant API context/tokens

Environment

  • Hermes Agent v0.9.x (gateway mode)
  • Platform: Feishu/Lark (but affects all messaging platforms)
  • Related: #11631 (no feedback during long tasks)

Suggested Implementation

The gateway already has _pending_messages infrastructure via merge_pending_message_event(). The change would be:

  1. Add a config flag gateway.message_queue_mode (default: "interrupt" for backward compatibility)
  2. In _handle_busy_session(): instead of calling running_agent.interrupt(), just store the event in the pending queue
  3. Send a lightweight queued acknowledgment instead of the interrupt message
  4. After run_agent() completes for the current task, check the pending queue and start a new run with the queued messages

extent analysis

TL;DR

Enable message queuing by setting gateway.message_queue_mode to "queue" to prevent interrupting the running agent and allow it to process incoming messages after completing the current task.

Guidance

  • Review the suggested implementation steps in the issue to understand the proposed changes to the gateway's message handling behavior.
  • Consider the impact of enabling message queuing on your specific use case, particularly for long-running tasks and multi-step workflows.
  • To test the new behavior, set gateway.message_queue_mode to "queue" and verify that the agent no longer interrupts the current task when receiving new messages.
  • Observe the agent's behavior when the current task completes and the queued messages are processed to ensure they are handled correctly.

Example

gateway:
  message_queue_mode: queue

This configuration change enables message queuing for all platforms.

Notes

The suggested implementation relies on the existing _pending_messages infrastructure, which may require additional testing to ensure correct functionality.

Recommendation

Apply the workaround by setting gateway.message_queue_mode to "queue" to prevent interrupting the running agent and allow it to process incoming messages after completing the current task. This change should improve the overall user experience by reducing interruptions and preserving progress on long-running tasks.

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

hermes - 💡(How to fix) Fix [Feature] Option to queue incoming messages instead of interrupting running tasks [1 comments, 1 participants]