fix(gateway): enhance message handling during agent tasks with queue …#13894
Closed
whitehatjr1001 wants to merge 1 commit into
Closed
fix(gateway): enhance message handling during agent tasks with queue …#13894whitehatjr1001 wants to merge 1 commit into
whitehatjr1001 wants to merge 1 commit into
Conversation
Contributor
|
Merged via #14762. Cherry-picked your commit onto current main with your authorship preserved in git log (commit 9d147f7). Thanks for the clean diff — picked this over the parallel implementations because the single |
23 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.
What does this PR do?
This PR fixes a bug in the gateway where messages sent while an agent was busy would always interrupt the active task, even when
display.busy_input_mode: queuewas configured.The problem was that
GatewayRunner._handle_active_session_busy_messageunconditionally calledagent.interrupt(). This caused long-running tools (likeprocess.wait()) to abort prematurely with an "interrupted" status.This fix aligns the gateway behavior with the existing logic in
cli.py(around line 9138), where interruptions are correctly gated by thebusy_input_modesetting.Related Issue
Fixes #13403
Type of Change
Changes Made
_handle_active_session_busy_messageto respectself._busy_input_mode. It now skipsrunning_agent.interrupt()when inqueuemode.⏳ Queued for the next turn... I'll respond once the current task finishes.test_queue_mode_suppresses_interrupt_and_updates_ackto ensure regression testing for this mode.How to Test
display.busy_input_mode: queuein yourconfig.yaml.hermes gateway run).sleep 10and tell me when done."sleep 10completes fully (no "interrupted" note), and the second question is answered only after the sleep finishes.Checklist
Code
Screenshots / Logs
Successful queue acknowledgment:
⏳ Queued for the next turn (running: terminal). I'll respond once the current task finishes.