gateway: debounce queued text follow-ups during active sessions (salvage of #31235)#31341
Merged
Conversation
Contributor
🔎 Lint report:
|
| Rule | Count |
|---|---|
invalid-assignment |
1 |
First entries
tests/gateway/test_active_session_text_merge.py:283: [invalid-assignment] invalid-assignment: Object of type `def _fake_start(event, session_key, *, interrupt_event=None) -> Unknown` is not assignable to attribute `_start_session_processing` of type `def _start_session_processing(self, event: MessageEvent, session_key: str, *, interrupt_event: Event | None = None) -> bool`
✅ Fixed issues: none
Unchanged: 4824 pre-existing issues carried over.
Diagnostics are surfaced as warnings — this check never fails the build.
CodeQL py/clear-text-logging-sensitive-data flagged the candidate-accept debug log including event.text[:60]. Log text_len instead — sufficient for debugging burst behavior without surfacing message contents. Co-authored-by: Paulo Nascimento <pnascimento9596@gmail.com>
Contributor
Author
3 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.

Salvage of #31235 by @pnascimento9596 — focused B1.2-only follow-up to the closed #29943.
What this makes true
When a user sends rapid text follow-ups during an active turn, all of them survive as one merged next-turn message instead of being clobbered or fragmenting the turn.
Mechanism
busy_text_mode=queue(default) onBasePlatformAdapter. Text follow-ups during an active session buffer into oneTextDebounceStateper session._pending_messages, so the timer never delays a follow-up turn — the agent finishing first cancels the timer.busy_text_mode=interruptpreserves legacy behavior unchanged.Mode interaction
Default pairing is
busy_input_mode=interrupt+busy_text_mode=queue— text follow-ups silently queue without firing the busy ack or interrupting the running turn. Photo/media still take their existing path.Env vars / config
HERMES_GATEWAY_BUSY_TEXT_MODE/display.busy_text_modequeueHERMES_GATEWAY_BUSY_TEXT_DEBOUNCE_SECONDS0.35HERMES_GATEWAY_BUSY_TEXT_HARD_CAP_SECONDS1.0Validation
Closes #31235.