fix: /queue now supports multiple queued messages via FIFO - #7707
Closed
willy-scr wants to merge 1 commit into
Closed
fix: /queue now supports multiple queued messages via FIFO#7707willy-scr wants to merge 1 commit into
willy-scr wants to merge 1 commit into
Conversation
The pending message store was Dict[str, MessageEvent] — one message per session. Sending /queue twice overwrote the first message. Only the last queued prompt was ever processed. Changes: - _pending_messages: Dict[str, MessageEvent] → Dict[str, list[MessageEvent]] - merge_pending_message_event() appends to list (photo bursts merge into last entry) - get_pending_message() pops first item (FIFO) - /queue handler appends instead of overwriting - /stop and /new drain the entire queue instead of just one item - Normal interrupt follow-ups also append (no overwrite)
Contributor
|
Thanks for the thorough write-up and the clean fix, @willy-scr! This automated hermes-sweeper review found that the same bug was independently addressed on
Main's implementation kept |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug
/queueonly stores one message per session. Sending/queue prompt Athen/queue prompt Bsilently overwrites A — only B is ever processed.Root Cause
_pending_messagesis typed asDict[str, MessageEvent]— a single value per session key. Every write (via/queue, interrupt follow-ups, or sentinel buffering) overwrites the previous entry:Fix
Change the data structure to a FIFO queue:
Changes
gateway/platforms/base.py:_pending_messagestype:Dict[str, MessageEvent]→Dict[str, list[MessageEvent]]merge_pending_message_event(): appends to list (photo bursts merge into last entry)get_pending_message(): pops first item (FIFO)_process_message_background: pops first from queue, processes it, then checks if more remaingateway/run.py:/queuehandler:adapter._pending_messages[key] = event→.setdefault(key, []).append(event)/stopand/new: drain entire queue instead of popping oneTesting
/queue task A/queue task B/queue task CBackward Compatibility
Photo burst merging still works — consecutive PHOTO events merge into the last queue entry instead of a single slot. No behavioral change for single-message queues.