fix(gateway): busy_input_mode queue uses FIFO instead of single-slot overwrite#28551
Open
zccyman wants to merge 1 commit into
Open
fix(gateway): busy_input_mode queue uses FIFO instead of single-slot overwrite#28551zccyman wants to merge 1 commit into
zccyman wants to merge 1 commit into
Conversation
…overwrite Replace merge_pending_message_event (single-slot replace) with _enqueue_fifo (slot + overflow list) in _handle_active_session_busy_message for queue mode. This ensures rapid follow-up messages are preserved in FIFO order rather than silently losing all but the last. Fixes NousResearch#28503.
This was referenced May 19, 2026
Open
3 tasks
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.
Summary
When
busy_input_mode: queueis configured, rapid follow-up messages sent while the agent is busy were silently lost — only the last message was preserved becausemerge_pending_message_event()was overwriting the single pending slot instead of appending to a FIFO queue.The gateway already has a proper FIFO implementation (
_enqueue_fifowith slot + overflow list), but the busy message path was bypassing it.Root cause
gateway/run.pyline 2887:Behavior change
Changes
gateway/run.py— 1-line changetests/gateway/test_busy_input_queue.py— 4 testsTesting
tests/gateway/test_busy_input_queue.py— 4/4 passedtests/gateway/test_steer_command.py— 5/5 passed (regression)Upstream gap discovered
Issue #14905 (
busy_input_mode: queueonly works during drain, not normal task execution) has the same root cause and no competing PR. This fix addresses both issues.Closes #28503