[Bob] Fix gateway restart final-delivery continuity - #68902
Open
trac3r00 wants to merge 1 commit into
Open
Conversation
Collaborator
teknium1
reviewed
Jul 30, 2026
teknium1
left a comment
Contributor
There was a problem hiding this comment.
Thanks for tracing the pre-ACK recovery gap and adding a real restart-boundary scenario.
Problems
- The new confirmation path in
gateway/platforms/base.pyonly runs after the normal final text send. A successful short Telegram auto-TTS reply ACKs its final text viaplay_tts()(gateway/platforms/base.py:5842-5850) and intentionally skips that text-send branch (gateway/platforms/base.py:5868). The proposedgateway/run.pycondition only confirmsalready_sentor intentional silence there, so this successful final-delivery path would retainresume_pending. - The new Slack test exercises ordinary text delivery, but not the caption-only path already covered by
tests/gateway/test_base_topic_sessions.py:285-304.
Suggested changes
- Centralize confirmation on every successful final user-visible payload, including TTS captions and attachment-only responses, and add the caption-only resume-pending regression.
Automated hermes-sweeper review.
| # The model turn is not a completed restart recovery until | ||
| # the platform has ACKed its final response. GatewayRunner | ||
| # deliberately keeps ``resume_pending`` set while the text | ||
| # is only a local return value; clear it here, after the |
Contributor
There was a problem hiding this comment.
This confirmation only follows the normal text _send_with_retry route. A successful short Telegram auto-TTS reply ACKs its final caption through play_tts() and skips the text-send block, so the proposed runner-side already_sent/silence fallback will leave resume_pending set. Please route every successful final payload, including caption-only TTS and attachment-only responses, through the same confirmation boundary.
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.
[Bob]
Summary
resume_pendingdurable until the messaging platform ACKs the final responseSendResult.successwhile preserving streaming and intentional-silence behaviorHERMES_HOME, realSessionDB, deterministic compression rollback/retry, turn-lease release, restart-boundary delivery ledger recovery, thread identity, and duplicate/output-leak assertionsRoot cause
The gateway cleared
resume_pendingas soon as the model turn returned, before the base adapter had recorded a delivery obligation or received a platform ACK. A restart in that gap left neither a resumable turn nor a durable final response. The reconnect auto-resume pass also recorded the restart-loop breaker twice in one boot (startup plus reconnect), suppressing recovery.Verification
resume_pending_during_send == [False]scripts/run_tests.shfocused continuity/regression set: 149 passed, 0 failed/tmpalias expectation, unsupported systemd abstract socket, file-descriptor exhaustion, and existing platform isolation failures)git diff --check: clean