#5909

feat(api): server-side message queue ("waiting room") while agent is busy

Opencoinwhopened 1mo ago

Problem / Motivation

When the agent is busy with a long task (e.g. browser automation to check grades), I can't interrupt it, but I also can't send a follow-up message — it either gets dropped or behaves unpredictably. I want to queue a message while the agent is busy and have it processed automatically when the current turn finishes.

The catch: a queue implemented only in the frontend is lost when the client disconnects (closing the laptop, closing the tab, network drop). The queue must live server-side so queued messages survive client disconnects.

Proposed Solution

  1. While a turn is active, incoming messages for that session go into a server-side queue instead of being dropped.
  2. The WebUI shows a "waiting room" indicator (e.g. below the composer) listing queued messages.
  3. When the current turn finishes, queued messages are processed automatically in order.
  4. The queue is persisted server-side, so it survives client disconnect — the messages are processed even if the user closes the laptop.
  5. (Nice-to-have) Users can cancel individual queued messages.

Alternatives Considered

  • Frontend-only queue: loses messages on client disconnect (the exact problem I want to avoid).
  • Blocking the composer while busy: works but forces the user to wait around.

Related Component

API Server

Additional Context

The WebUI already has a pendingMessageSends mechanism for tracking sends that haven't been acknowledged by the server (reconnection resilience), but it is not a user-visible queue and not server-side persisted. Related: #3938 (message buffering for group chat channels) covers a different scenario.

Activity

0

No activity yet.