fix: notify gateway when QQ bot adapter exhausts reconnect attempts#15510
Open
vominh1919 wants to merge 2 commits into
Open
fix: notify gateway when QQ bot adapter exhausts reconnect attempts#15510vominh1919 wants to merge 2 commits into
vominh1919 wants to merge 2 commits into
Conversation
Add shutdown guard to sync_turn() and defense-in-depth loop.is_closed() check in _run_sync() to prevent RuntimeError during interpreter teardown. Fixes NousResearch#15497
_listen_loop had 5 exit paths that returned without calling _notify_fatal_error(), leaving the adapter as a zombie in the gateway. The gateway never learned the adapter died and could not restart it. Now all exit paths call _set_fatal_error() + _notify_fatal_error() so the gateway can trigger recovery (same pattern as Telegram adapter). Fixes NousResearch#15490
Collaborator
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.
Fixes #15490
Problem
When the host network goes down, the QQ bot adapter silently dies during WebSocket reconnect. The gateway never learns the adapter failed and cannot restart it.
Root Cause
_listen_loophas 5 exit paths thatreturnwithout calling_notify_fatal_error(). Compare with Telegram adapter which correctly calls both_set_fatal_error()+_notify_fatal_error()on all exit paths.Fix
All 5 exit paths now call
_set_fatal_error()+_notify_fatal_error()before returning, matching the Telegram adapter pattern.Files Changed
gateway/platforms/qqbot/adapter.py— 20 lines added