[GH-ISSUE #22931] [Bug]: Message queue stuck after rapid chat switching - queued messages not auto-sent #35373

Closed
opened 2026-04-25 09:35:25 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @ai-nurmamat on GitHub (Mar 22, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/22931

Bug Summary

When using Message Queue feature, rapid switching between conversations causes the queue to get stuck. Queued messages remain but are not automatically sent when the conversation is in a stopped state.

Steps to Reproduce

  1. Enable Message Queue in settings
  2. Start sending prompts quickly so multiple prompts are queued
  3. While generation/queueing is ongoing, repeatedly switch between different conversations
  4. Continue sending messages in each conversation to build up queued items
  5. Wait until one conversation appears as "stopped" (no active generation)

Expected Behavior

  1. If there are pending queued messages and no active generation/task, queued messages should automatically continue sending in order
  2. Conversation switching should not break queue consumption

Actual Behavior

  1. The conversation is no longer generating (stopped state)
  2. The queue still contains pending messages
  3. Pending queued messages are not automatically dispatched anymore
  4. Queue remains stuck until manual intervention

Root Cause Analysis

The issue likely stems from the queue consumer not properly handling conversation context switches. When rapidly switching between conversations:

  1. The active conversation context gets replaced
  2. The queue consumer loses track of which conversation the pending messages belong to
  3. The consumer may be waiting for a generation signal that will never come for the stopped conversation

Likely Code Location

  • backend/apps/webui/routers/chat.py - Chat completion endpoint
  • backend/apps/webui/routers/queue.py - Queue management
  • Frontend state management for conversation switching

Suggested Fix

  1. Add conversation ID validation before dispatching queued messages
  2. Implement a queue consumer that can handle multiple conversation contexts
  3. Add automatic retry mechanism when queue is stuck
  4. Consider using a persistent queue (Redis) instead of in-memory queue

Impact

  • User experience degradation when using message queue
  • Messages stuck in queue require manual intervention
  • Poor reliability in multi-conversation scenarios

Labels

bug, message-queue, chat-switching

Originally created by @ai-nurmamat on GitHub (Mar 22, 2026). Original GitHub issue: https://github.com/open-webui/open-webui/issues/22931 ## Bug Summary When using Message Queue feature, rapid switching between conversations causes the queue to get stuck. Queued messages remain but are not automatically sent when the conversation is in a stopped state. ## Steps to Reproduce 1. Enable Message Queue in settings 2. Start sending prompts quickly so multiple prompts are queued 3. While generation/queueing is ongoing, repeatedly switch between different conversations 4. Continue sending messages in each conversation to build up queued items 5. Wait until one conversation appears as "stopped" (no active generation) ## Expected Behavior 1. If there are pending queued messages and no active generation/task, queued messages should automatically continue sending in order 2. Conversation switching should not break queue consumption ## Actual Behavior 1. The conversation is no longer generating (stopped state) 2. The queue still contains pending messages 3. Pending queued messages are not automatically dispatched anymore 4. Queue remains stuck until manual intervention ## Root Cause Analysis The issue likely stems from the queue consumer not properly handling conversation context switches. When rapidly switching between conversations: 1. The active conversation context gets replaced 2. The queue consumer loses track of which conversation the pending messages belong to 3. The consumer may be waiting for a generation signal that will never come for the stopped conversation ### Likely Code Location - `backend/apps/webui/routers/chat.py` - Chat completion endpoint - `backend/apps/webui/routers/queue.py` - Queue management - Frontend state management for conversation switching ### Suggested Fix 1. Add conversation ID validation before dispatching queued messages 2. Implement a queue consumer that can handle multiple conversation contexts 3. Add automatic retry mechanism when queue is stuck 4. Consider using a persistent queue (Redis) instead of in-memory queue ## Impact - User experience degradation when using message queue - Messages stuck in queue require manual intervention - Poor reliability in multi-conversation scenarios ## Labels bug, message-queue, chat-switching
Author
Owner

@jhammons commented on GitHub (Mar 24, 2026):

Hi @tjbck , thanks for your work! I came by interested in the parent issue (something I am experiencing with minor use) but I saw you closed it as completed. Is it perhaps a duplicate? Is there an issue I can follow to track elsewhere? I may not be sharp enough to troubleshoot this but would be willing to take a look if nobody else is. Thank you.

<!-- gh-comment-id:4117063460 --> @jhammons commented on GitHub (Mar 24, 2026): Hi @tjbck , thanks for your work! I came by interested in the parent issue (something I am experiencing with minor use) but I saw you closed it as completed. Is it perhaps a duplicate? Is there an issue I can follow to track elsewhere? I may not be sharp enough to troubleshoot this but would be willing to take a look if nobody else is. Thank you.
Author
Owner

@Classic298 commented on GitHub (Mar 24, 2026):

@jhammons thanks for offering your time; please test the dev branch and try to reproduce, it should be fixed there. Then report back thanks

<!-- gh-comment-id:4117090201 --> @Classic298 commented on GitHub (Mar 24, 2026): @jhammons thanks for offering your time; please test the dev branch and try to reproduce, it should be fixed there. Then report back thanks
Author
Owner

@jhammons commented on GitHub (Mar 24, 2026):

You are correct--dev branch is currently working well. Thank you!

<!-- gh-comment-id:4117264016 --> @jhammons commented on GitHub (Mar 24, 2026): You are correct--dev branch is currently working well. Thank you!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#35373