fix(gateway): use FIFO queue for busy_input_mode pending messages#33817
Merged
kshitijk4poor merged 2 commits intoJun 8, 2026
Conversation
Collaborator
sweetcornna
force-pushed
the
fix/28503-busy-input-fifo
branch
from
June 3, 2026 12:32
f03eb1a to
fec5ca7
Compare
alt-glitch
pushed a commit
that referenced
this pull request
Jun 14, 2026
fix(gateway): use FIFO queue for busy_input_mode pending messages
This was referenced Jun 15, 2026
T02200059
pushed a commit
to T02200059/hermes-agent
that referenced
this pull request
Jun 18, 2026
…-input-fifo fix(gateway): use FIFO queue for busy_input_mode pending messages
waefrebeorn
pushed a commit
to waefrebeorn/slermes
that referenced
this pull request
Jul 2, 2026
…-input-fifo fix(gateway): use FIFO queue for busy_input_mode pending messages
liuchanchen
pushed a commit
to liuchanchen/hermes-agent
that referenced
this pull request
Jul 3, 2026
…-input-fifo fix(gateway): use FIFO queue for busy_input_mode pending messages
santhreal
pushed a commit
to santhreal/hermes-agent
that referenced
this pull request
Jul 13, 2026
…-input-fifo fix(gateway): use FIFO queue for busy_input_mode pending messages
spectrum-128k
pushed a commit
to spectrum-128k/hermes-agent-upstream-fork
that referenced
this pull request
Jul 15, 2026
…-input-fifo fix(gateway): use FIFO queue for busy_input_mode pending messages
kulikman
pushed a commit
to kulikman/hermes-agent
that referenced
this pull request
Jul 16, 2026
…-input-fifo fix(gateway): use FIFO queue for busy_input_mode pending messages
Gravezzz
pushed a commit
to Gravezzz/hermes-agent
that referenced
this pull request
Jul 21, 2026
…-input-fifo fix(gateway): use FIFO queue for busy_input_mode pending messages
waym0reom3ga
added a commit
to waym0reom3ga/autolycus-agent
that referenced
this pull request
Jul 21, 2026
…-input-fifo fix(gateway): use FIFO queue for busy_input_mode pending messages
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
busy_input_mode: queue, rapid follow-up text messages were silently overwriting a single pending slot (merge_pending_message_event(..., merge_text=False)), so the agent only saw the most recent message after the current turn finished. Now_queue_or_replace_pending_eventroutes through the FIFO infrastructure already used by/queue(_enqueue_fifo+ the existing_promote_queued_eventdrain hook), preserving each follow-up as its own turn in arrival order.merge_pending_message_event(album semantics intact); only distinct-turn events fall through to the overflow tail.32pending follow-ups (_BUSY_QUEUE_MAX_PENDING) so a stuck agent + rapid-fire user cannot grow the overflow unboundedly. There is no obvious precedent in the codebase for a configurable bound here;32is far beyond realistic conversational backlog while still trivially small in memory. Items beyond the cap are dropped with alogger.warning(matches the existing pattern used elsewhere for queue caps)._queue_or_replace_pending_event:busy_input_mode: queue, the steer-fallback-to-queue path, the subagent demotion path ([Bug]: Sending a message while delegate_task is running kills the subagent — interrupt propagates unconditionally to children #30170), and the draining/restart paths.Test plan
pytest tests/gateway/test_queue_consumption.py— 14 pass (11 existing + 3 new:test_rapid_text_followups_are_queued_in_fifo_order,test_queue_respects_bounded_cap,test_photo_burst_still_merges_in_head_slot).pytest tests/gateway/test_busy_session_ack.py tests/gateway/test_busy_session_auth_bypass.py tests/gateway/test_interrupt_key_match.py tests/gateway/test_text_batching.py tests/gateway/test_telegram_text_batching.py tests/tools/test_interrupt.py tests/cli/test_quick_commands.py— 79 pass (no regressions in adjacent suites).display.busy_input_mode: queue, send a slow-running prompt, then fire 5 rapid follow-ups — confirm all 5 are processed sequentially after the current turn ends.