fix(gateway): respect busy_input_mode=queue during normal agent runs#14762
Merged
Conversation
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
Queue mode now works during normal operation, not just during gateway restart drain. With
display.busy_input_mode: queue, a second message arriving while the agent is working gets queued for the next turn instead of callingrunning_agent.interrupt()— which was killing in-flightdelegate_tasksubagents.Default (
interrupt) behavior is unchanged. Opt-in only.Root cause
_handle_active_session_busy_message()unconditionally calledrunning_agent.interrupt(event.text). The_busy_input_modeconfig was only consulted inside_queue_during_drain_enabled(), so queue mode silently did nothing outside restart drain.Changes
gateway/run.py: branch onis_queue_mode = self._busy_input_mode == 'queue'before callinginterrupt(); ack wording branches betweenInterruptingandQueued for the next turn. All other debounce/status logic stays shared.tests/gateway/test_busy_session_ack.py: addstest_queue_mode_suppresses_interrupt_and_updates_ack.Validation
8 tests pass in tests/gateway/test_busy_session_ack.py (including the new queue-mode test).
Credit
Salvaged from #13894 by @whitehatjr1001 — cleanest of three parallel fixes (#8544, #12235, #13894) for the same bug. Also credit to @dpaluy (#12235) for an earlier implementation. Repro and confirmation from @barteq100 in Discord reporting that interrupt-mode broke his
research_queueTelegram topic skill by killingdelegate_tasksubagents.Closes #12235, #13894, #8544.