Skip to content

[BUG] Message queue race condition causes messages to vanish during LLM processingΒ #8536

@hannesrudolph

Description

@hannesrudolph

Type

Bug

Problem / Value

Messages sent from the chat UI silently disappear when sent at a specific timing during message queue processing, causing user frustration and lost input. This affects all users when they send a message while a previously queued message is being processed by the LLM.

Context

Affects all users when sending messages through the chat UI while the message queue is being processed. The issue occurs when:

  • A user sends message A, which gets queued
  • Message A is dequeued and begins LLM processing
  • User sends message B while message A is still being processed
  • Message B vanishes without being added to the queue
  • If user sends message B again, it successfully gets queued

Current observed behavior: Messages sent during the brief window after a queued message is dequeued but before LLM processing completes are lost without any error indication.

Reproduction

  1. Send a message from chat UI (message A) while LLM is busy - it gets added to queue
  2. Wait for message A to come off the queue and start LLM processing
  3. While message A is being processed by LLM, send another message (message B) from chat UI
  4. Expected result: Message B should be added to the message queue
  5. Actual result: Message B silently disappears without being queued or processed
  6. Send message B again while message A is still processing - now it gets queued successfully

Constraints/Preferences

The message queue logic should ensure all user messages are captured during any LLM processing state, including when processing messages that were previously dequeued. The race condition appears to be in the timing check around line 802 in Task.ts where isMessageQueued is evaluated before the message handling logic, causing a window where new messages aren't properly queued.

Metadata

Metadata

Assignees

Labels

Issue - In ProgressSomeone is actively working on this. Should link to a PR soon.bugSomething isn't working

Type

No type

Projects

Status

Issue [In Progress]

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions