fix(gateway): preserve depth-capped interrupt follow-ups - #61027
Open
embwl0x wants to merge 1 commit into
Open
Conversation
embwl0x
force-pushed
the
agent/telegram-voice-interrupt-queue
branch
from
July 10, 2026 09:26
697de30 to
ca59a5e
Compare
embwl0x
marked this pull request as ready for review
July 10, 2026 09:26
Contributor
|
Thanks for isolating the plain-text fallback separately from the retained voice-event path.
Automated hermes-sweeper review. |
embwl0x
force-pushed
the
agent/telegram-voice-interrupt-queue
branch
4 times, most recently
from
July 30, 2026 04:32
e1f420a to
5803948
Compare
embwl0x
force-pushed
the
agent/telegram-voice-interrupt-queue
branch
from
July 30, 2026 04:38
5803948 to
e793876
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.
Summary
Fixes #61008.
When an interrupt-drain chain reaches
_MAX_INTERRUPT_DEPTH, the gateway currently tries to park a remaining stringinterrupt_messageviaadapter.queue_message(...). Normal gateway adapters use_pending_messagesand do not implement that legacy method, so a transcribed voice follow-up can be dropped exactly when the recursion guard fires.This patch adds a shared
GatewayRunner._requeue_interrupt_depth_pending()helper that:MessageEventthrough the existing FIFO pending-event path,MessageEventwhen no full event remains,queue_message()fallback only for non-standard adapters without_pending_messages.Validation
uv run --extra dev pytest tests/gateway/test_queue_consumption.py -q— 16 passeduv run --extra dev pytest tests/gateway/test_stt_config.py tests/gateway/test_telegram_audio_vs_voice.py -q— 12 passeduv run --extra dev pytest tests/gateway/test_busy_session_ack.py -q— 26 passeduv run --extra dev pytest tests/gateway/test_run_progress_interrupt.py tests/gateway/test_pending_drain_no_recursion.py tests/gateway/test_internal_event_never_interrupts_busy_session.py -q— 10 passeduv run --extra dev pytest tests/gateway/test_queue_command.py tests/gateway/test_busy_session_auth_bypass.py tests/gateway/test_subagent_protection_30170.py -q— 26 passeduv run --extra dev pytest tests/gateway -q -k "queue or interrupt or voice"— 442 passed, 7 skipped, 8515 deselecteduv run --extra dev ruff check gateway/run.py tests/gateway/test_queue_consumption.py— passedpython -m py_compile gateway/run.py tests/gateway/test_queue_consumption.py— passedgit diff --check origin/main..HEAD— passedgitleaks git --log-opts='origin/main..HEAD' --redact .— no leaks foundDuplicate / overlap check
61008 in:title,bodyreturned no results immediately before push.preflight_issue.py 61008 --keyword interrupt_depth --keyword _MAX_INTERRUPT_DEPTH --keyword queue_message --keyword voice-interruptwarned on broad queue/interrupt work only.Those do not preserve a depth-capped gateway interrupt transcript as a pending turn.