fix(gateway): keep QQBot reconnect loop alive - #25361
Closed
magic524 wants to merge 1 commit into
Closed
Conversation
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.
What does this PR do?
Keeps the QQBot adapter's reconnect loop alive after transient WebSocket disconnects.
Previously, QQBot used
_mark_disconnected()for transport-level drops. That method also sets_running = False, so if a reconnect attempt failed once, for example while fetching the QQ gateway URL, the listener loop could stop permanently. The adapter would then stay disconnected until the whole gateway process was restarted.This PR separates transient WebSocket transport state from adapter lifecycle state, so QQBot can keep retrying reconnects while still reporting itself as disconnected to runtime status.
Related Issue
No issue yet.
Type of Change
Changes Made
gateway/platforms/qqbot/adapter.py_mark_transport_disconnected()for transient QQ WebSocket drops.is_connectedcheck the actual WebSocket transport state.tests/gateway/test_qqbot.pyHow to Test
scripts/run_tests.sh tests/gateway/test_qqbot.py -q.venv/bin/python scripts/check-windows-footguns.py gateway/platforms/qqbot/adapter.py tests/gateway/test_qqbot.py.Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/AFor New Skills
N/A
Screenshots / Logs
Validation: