#3408·picoclaw

[BUG] Web UI: messages sent while the agent is busy are queued invisibly and dropped silently when the queue is full (no UI feedback) + request for a queue/events surface

Author: racso2609Created Sep 29, 2026Updated Sep 30, 2026

Quick Summary

In the Web UI, when the agent is busy (a turn is still running), any message you send is queued as steering input and never shown in the chat. There is no "queued / agent busy" feedback, so the message seems to vanish — until the turn finishes and the reply appears with no visible request that caused it. Worse, when the queue fills up the message is dropped silently and never delivered at all. This report traces the exact code paths and proposes both a fix and, as a feature request, a small in-UI "queue/events" surface so the user can see what is happening behind the scenes.

Environment & Tools

  • PicoClaw Version: v0.3.1 (git 2cf030d2)
  • Go Version: go1.25.11
  • AI Model & Provider: any
  • Operating System: Linux amd64
  • Channels: Web UI (pico channel)

Steps to Reproduce

  1. Open the Web UI and send a message that starts a long turn (many tool calls).
  2. While the turn is still running, send one or more additional messages.
  3. Watch the chat: the extra message(s) never appear as your own bubbles.
  4. (For the loss case) Keep sending while the agent is busy until more than 10 messages are queued.

❌ Actual Behavior

Three distinct problems:

  1. Queued messages are invisible. A message sent during an active turn is not echoed to the Web UI. The frontend only appends the user's bubble when it calls sendChatMessage; the backend never echoes inbound messages back over the pico WebSocket, so a message that took the steering path is never rendered. The user sees nothing until the assistant replies — with no visible prompt that triggered it.
  2. Messages are dropped silently when the queue is full. The per-session steering queue is capped at MaxQueueSize = 10 (pkg/agent/steering.go:27). When full, pushScope returns steering queue is full (steering.go:79), and the routing code in Run() only writes a server-side warning (pkg/agent/agent.go:204) — the client is never told. The message is lost forever: never executed, never persisted, never shown. The user keeps typing into the void.
  3. A queued message can appear and then vanish. Steering is persisted at injection time via Sessions.AddFullMessage (pkg/agent/turn_coord.go:165), i.e. mid-turn. If that turn subsequently errors, the user's steering message is already in the session file, so it surfaces in the transcript as if it had been handled — while the actual behavior did diverge.

Net effect: the user has no way to know their message is queued, delivered, or dropped, and the transcript cannot be trusted to reflect what was queued.

✅ Expected Behavior

  • A message sent while the agent is busy should be visible immediately in the chat, with a clear "queued / waiting for the agent" state.
  • If the message cannot be queued (queue full), the client must be told, and the message must not be silently discarded.
  • The transcript should distinguish messages that were queued from messages that were actually processed, and should not show an unprocessed steering message as if it had been answered.

Root-cause analysis (current steering/queue handling)

Verified against main. Relevant pieces:

  • pkg/agent/steering.go — per-session steering queue; MaxQueueSize = 10; pushScope errors with steering queue is full when full (:27, :79).
  • pkg/agent/agent.go — Run() routing: if a turn is already active for the session (activeTurnStates.LoadOrStore returns loaded), the message is sent to enqueueSteeringMessage; on failure it only logs "Failed to enqueue steering message" (:204).
  • pkg/agent/turn_coord.go — steering is injected between iterations and persisted at injection time (:159-187, AddFullMessage at :165).
  • pkg/channels/pico/pico.go — the message.send path (handleMessageSend) publishes the inbound message; the server does not echo the user message back. Outbound message.create frames are only sent for assistant/placeholder/streaming content.
  • web/frontend/src/features/chat/controller.ts — the client appends the user bubble locally and sets isTyping: true; there is no backend echo, and no "queued" state.
  • web/frontend/src/features/chat/protocol.ts — handles message.create/update/delete, typing.start/stop, error; there is no queued/queue message type.
  • Runtime events exist server-side but are not consumed by the pico channel: agent.interrupt.received (KindAgentInterruptReceived, emitted in steering.go:246 with QueueDepth) and agent.follow_up.queued (KindAgentFollowUpQueued). The pico channel does not subscribe to the runtime event bus at all.

So the frontend has no signal to render a queue state, and the backend has no channel-bound feedback for "enqueued", "queue full/dropped", or "injected".

Proposed fix

  • Echo/ack the queued message. When an inbound message is routed to the steering queue, emit a WS frame back to that session (e.g. an ACK carrying the client message.id plus queued: true / queue_depth). The frontend then renders the bubble immediately with a "queued" badge.
  • Report queue-full as a real error. Instead of only logging, return a pico error frame (the client already handles type:"error" with request_id in protocol.ts:226) so the UI can show "message not delivered — agent busy" and optionally let the user retry. Do not drop silently.
  • Only persist on injection (or mark queued). Keep the current injection-time persistence, but expose the prompt_source/slot (PromptSlotSteering, PromptSourceSteering) through the session API so the transcript can label it as a queued steering message rather than a plain user message.
  • Consider a non-interrupting "after-turn" mode as the default for busy-time chat input (see #3342), so a typed-ahead message is a follow-up instead of a mid-task interruption.

Feature request: a "queue / events" surface in the Web UI

Beyond the fix, it would be very useful to have an in-UI place that shows what is happening during heavy/busy situations, for example:

  • a small Queue/Events panel (or a per-session "activity" badge) listing pending steering/follow-up messages per session with their depth;
  • explicit states: queued (depth N) → injected → processed, and dropped (queue full);
  • surface the already-emitted runtime events (agent.interrupt.received with QueueDepth, agent.follow_up.queued, agent.steering.injected) to the pico channel so the UI can render them without new backend plumbing;
  • optionally expose MaxQueueSize, steering_mode, and max_parallel_turns so the user understands the caps.

This would remove the current "black box": today, when PicoClaw is saturated, the UI neither warns that something was queued nor that it was dropped.

Additional Context

  • Related: #3342 (opt-in "after-turn" steering mode — closed), #3406 (session list / separate manual vs channel sessions), #3407 (active session disappears from the list while thinking). This issue is about the queue/steering feedback, distinct from those.
  • The two paths (invisible echo vs silent drop) are independent bugs, but they share the same missing piece: the pico channel does not forward queue/steering state (or runtime events) back to the client.