[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
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 (
picochannel)
Steps to Reproduce
- Open the Web UI and send a message that starts a long turn (many tool calls).
- While the turn is still running, send one or more additional messages.
- Watch the chat: the extra message(s) never appear as your own bubbles.
- (For the loss case) Keep sending while the agent is busy until more than
10messages are queued.
❌ Actual Behavior
Three distinct problems:
- 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 thepicoWebSocket, 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. - 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,pushScopereturnssteering queue is full(steering.go:79), and the routing code inRun()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. - 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;pushScopeerrors withsteering queue is fullwhen full (:27,:79).pkg/agent/agent.go—Run()routing: if a turn is already active for the session (activeTurnStates.LoadOrStorereturns loaded), the message is sent toenqueueSteeringMessage; 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,AddFullMessageat:165).pkg/channels/pico/pico.go— themessage.sendpath (handleMessageSend) publishes the inbound message; the server does not echo the user message back. Outboundmessage.createframes are only sent for assistant/placeholder/streaming content.web/frontend/src/features/chat/controller.ts— the client appends the user bubble locally and setsisTyping: true; there is no backend echo, and no "queued" state.web/frontend/src/features/chat/protocol.ts— handlesmessage.create/update/delete,typing.start/stop,error; there is noqueued/queuemessage type.- Runtime events exist server-side but are not consumed by the
picochannel:agent.interrupt.received(KindAgentInterruptReceived, emitted insteering.go:246withQueueDepth) andagent.follow_up.queued(KindAgentFollowUpQueued). Thepicochannel 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.idplusqueued: 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
picoerrorframe (the client already handlestype:"error"withrequest_idinprotocol.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, anddropped (queue full); - surface the already-emitted runtime events (
agent.interrupt.receivedwithQueueDepth,agent.follow_up.queued,agent.steering.injected) to thepicochannel so the UI can render them without new backend plumbing; - optionally expose
MaxQueueSize,steering_mode, andmax_parallel_turnsso 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
picochannel does not forward queue/steering state (or runtime events) back to the client.
Source: sipeed/picoclaw