You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(chat): frontend message queue — send-while-streaming queues, no disabled input
Reworks the queue UX per design feedback:
- **Send renders in the body.** A message sent to an idle thread submits
normally and renders in the thread's user-message place + streams.
- **No disabled composer state, only a streaming state.** Tools, the
microphone, and the mode pills are always enabled now; only the primary
button reflects streaming (Send when there's a draft, Stop otherwise).
- **Send while a run is active → the queue, not the body.** New
`conn.enqueue()` POSTs the message to the gate quietly (no optimistic body
row, no run-status change); the message is mirrored into a per-thread
frontend queue and surfaces in the panel. It renders in the body only when
its turn dequeues and streams.
- **Frontend message queue.** New module-scoped per-thread store
(`message-queue-store.ts`) with `useMessageQueue(threadId)` +
`useMessageQueueActions()` hooks (enqueue / cancel / refresh). Seeded from
the gate on mount, written optimistically on send, and re-synced on every
SSE run start/end edge and on terminal `onFinish`. Replaces the
React-Query `useThreadQueue` (deleted) and the `KEYS.threadQueue` key.
`selectWaitingQueueItems` still excludes the active head so the running
message never double-renders.
Verified live (Codex-desktop thread): message renders in the body + streams;
Tools/mic stay enabled mid-run; a message sent behind a running gate lands in
the panel (not the body) and cancels cleanly.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
0 commit comments