fix(gateway): honor queue mode in runner PRIORITY interrupt path#15385
Merged
Conversation
When display.busy_input_mode is 'queue', the runner-level PRIORITY block in _handle_message was still calling running_agent.interrupt() for every text follow-up to an active session. The adapter-level busy handler already honors queue mode (commit 9d147f7), but this runner-level path was an unconditional interrupt regardless of config. Adds a queue-mode branch that queues the follow-up via _queue_or_replace_pending_event() and returns without interrupting. Salvages the useful part of #12070 (@knockyai). The config fan-out to per-platform extra was redundant — runner already loads busy_input_mode directly via _load_busy_input_mode().
1 task
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
display.busy_input_mode: queuenow actually queues text follow-ups at every entry point. The runner-level PRIORITY block in_handle_messagewas still callingrunning_agent.interrupt()regardless of config, even though the adapter-level busy handler already honored queue mode (commit 9d147f7).Changes
gateway/run.py: queue-mode branch before the PRIORITY interrupt — calls_queue_or_replace_pending_event()and returns Nonetests/gateway/test_busy_session_ack.py: regression test driving the full_handle_messagepath in queue modeAttribution
Salvage of #12070 by @knockyai — authorship preserved via cherry-pick. The original PR's config fan-out (propagating
display.busy_input_modeinto each platform'sextra) was dropped as redundant: the runner already loads this value directly via_load_busy_input_mode().Validation
scripts/run_tests.sh tests/gateway/test_busy_session_ack.py tests/gateway/test_restart_drain.py tests/gateway/test_duplicate_reply_suppression.py→ 45 passedCloses #12070.