Skip to content

Feature request: Message queue for gateway (don't interrupt running agent) #4772

@pekka-lab

Description

@pekka-lab

Problem

When a user sends a message while the agent is already working on a task, the new message interrupts the running agent. The previous task is lost — the agent cannot resume where it left off.

This is especially problematic for:

  • Long-running tasks (cron analysis, file processing, multi-step operations)
  • Users who want to queue follow-up messages while waiting
  • Production setups where bots run proactive tasks that shouldn't be interrupted by casual messages

Current behavior

  • New message → agent.interrupt() → previous task killed
  • _pending_messages dict exists but is cleared on interrupt
  • No way to queue messages for processing after current task completes

Desired behavior

  • New messages are queued while agent is busy
  • Agent finishes current task, then processes queued messages in order
  • Optional: send a brief 'I'm working on X, your message is queued' acknowledgment
  • /stop should still force-kill as it does today

Context

Coming from OpenClaw which had message queuing. The interrupt behavior makes the gateway feel unreliable for power users who interact frequently with their bots.

Environment

  • Hermes v0.6.0+
  • Gateway with Telegram platform
  • Multiple profiles (6 bots)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions