fix(gateway): pass merge_text=True in queue mode to prevent silent message drops (#28503)#28606
Open
Bartok9 wants to merge 1 commit into
Open
fix(gateway): pass merge_text=True in queue mode to prevent silent message drops (#28503)#28606Bartok9 wants to merge 1 commit into
Bartok9 wants to merge 1 commit into
Conversation
Collaborator
2 tasks
Contributor
Author
|
Closing to stay within contributor PR limit. Will resubmit with fresh rebase if the issue remains open in main. |
ba5814e to
d584f06
Compare
3 tasks
d584f06 to
f2667af
Compare
…ops (NousResearch#28503) busy_input_mode: queue relied on _queue_or_replace_pending_event, which called merge_pending_message_event without merge_text=True. For plain TEXT follow-ups this fell through to the single-slot assignment: pending_messages[session_key] = event # overwrites So sending messages A, B, C while the agent was busy would result in only C being processed; A and B were silently dropped. Fix: pass merge_text=True from _queue_or_replace_pending_event so sequential text messages are accumulated (newline-separated) rather than overwritten. Photo/media burst merging is unaffected because those branches in merge_pending_message_event return early before the merge_text check. Adds two regression tests: - test_queue_mode_accumulates_multiple_text_followups: verifies A+B+C are all preserved in the combined pending slot. - test_queue_mode_single_message_unchanged: verifies first-message behaviour is unmodified (no regression). Closes NousResearch#28503
f2667af to
13ba7ab
Compare
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.
Problem
When
busy_input_mode: queueis configured, users who send multiple messages rapidly while the agent is processing only see their last message acted on. All previous messages are silently discarded.Root cause:
_queue_or_replace_pending_eventcalledmerge_pending_message_eventwithoutmerge_text=True, so the plain-text path fell through to a single-slot assignment:Sending messages A, B, C while the agent is busy → only C survives.
Fix
Pass
merge_text=Truefrom_queue_or_replace_pending_eventso sequential TEXT messages accumulate (newline-separated) into the pending slot instead of overwriting it.Photo/media burst merging is unaffected — those branches in
merge_pending_message_eventreturn early before themerge_textcheck is reached.Tests
Two new regression tests in
tests/gateway/test_busy_session_ack.py:test_queue_mode_accumulates_multiple_text_followups— verifies that A, B, C are all present in the combined pending event after three rapid queue-mode follow-ups.test_queue_mode_single_message_unchanged— verifies first-message behaviour is unmodified (no regression).All 17 existing busy-session tests continue to pass.
Closes #28503