Skip to content

feat: queue messages during a reply, and send them when Escape stops it - #53

Merged
bencode merged 1 commit into
mainfrom
feat/message-queue
Oct 1, 2026
Merged

bencode merged 1 commit into
mainfrom
feat/message-queue

Conversation

@bencode

@bencode bencode commented Oct 1, 2026 •

Copy link
Copy Markdown
Owner

What

While a reply is running, Enter (or the new Queue message button) adds the message to a visible queue above the composer instead of being swallowed.

  • At the next turn boundary, queued messages are handed to the model (agent.steer, steeringMode: 'all'), each as its own user message.
  • Escape (or Stop) aborts the reply; anything still queued is sent straight away as the next prompt.
  • If the reply ends with a provider error, the queue is returned to the draft instead of being resent.
  • Each queued item can be removed before it is sent.

Model

type StoredConversation = { ...; draft: ConversationDraft; queued?: ConversationDraft[] }
  • The queue lives on the conversation row next to draft, so it survives closing the tab.
  • A queued message sits either in conversations[id].queued or in messages, never both.
  • Taking from the queue only changes memory. The next message_end writes the emptied queue and the message in the same IndexedDB transaction (appendStoredConversationMessages).
  • Opening a conversation (getStoredConversation / touchStoredConversation) folds any leftover queue into the draft through foldQueued, queued text first, then the existing draft. Switching away mid-reply does the same.
  • restore on draft attachments no longer cuts to 10. A folded draft can pass the limit; adding is refused until files are removed, and nothing is dropped.

Tests

  • Integration: a queued message reaches the model after the tool result.
  • Integration: Escape aborts and sends the queue.
  • Integration: the existing streaming test now covers queue, remount and remove.
  • Store: reopening returns the queue to the draft.
  • pnpm typecheck, pnpm test (260) and pnpm test:integration (55) pass; biome check is clean.

Verification

  • Consecutive user messages: checked against the live proxy for zai-coding-cn/glm-5.3 and deepseek/deepseek-v4-flash. Both accept them and answer the later message. Direct BYOK vendors outside these two are still unchecked.
  • Manual run: the author tried it on desktop. Not yet run on a real phone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant