fix(qqbot): accept is_reconnect kwarg in connect() matching base-class contract (#59272) - #59317
Closed
Tranquil-Flow wants to merge 1 commit into
Closed
Conversation
…s contract (NousResearch#59272) QQAdapter.connect() was missed in the refactor that added the keyword-only is_reconnect parameter to the base class (commit 43b8ba4). The gateway always passes connect(is_reconnect=...) at gateway/run.py:3395 and :3398, so QQ fails with TypeError on every first connect and enters a permanent exponential-backoff reconnect loop. The one-line signature fix adds to match the base class and every other platform adapter. QQ is a stateless adapter that does a full fresh auth on every connect, so accepting and ignoring is_reconnect is safe — the same pattern used by WhatsApp, WeChat, and other stateless platforms.
Collaborator
Duplicate of #52966 (earliest still-open canonical fix for the same |
Contributor
|
Thanks for the focused QQ reconnect-contract fix. This is now already implemented on current
Automated hermes-sweeper review. |
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 #59272 —
QQAdapter.connect()raisesTypeError: QQAdapter.connect() got an unexpected keyword argument 'is_reconnect'on every first connect, sending QQ into a permanent exponential-backoff reconnect loop (60s → 120s → 240s → 300s) until the platform is patched locally.Root Cause
Commit
43b8ba418(fix(telegram): preserve Bot API update queue on watcher reconnect) changed the abstract base class signature ingateway/platforms/base.py:Every other platform adapter (bluebubbles, signal, webhook, weixin, whatsapp_cloud, yuanbao, msgraph_webhook, api_server) was updated to match.
QQAdapterwas missed:The gateway call sites at
gateway/run.py:3395and:3398passconnect(is_reconnect=...), so QQAdapter raisesTypeErrorimmediately and never starts.Fix
One-line signature change in
gateway/platforms/qqbot/adapter.py:281:QQ is a stateless adapter — every connect performs a full fresh auth + WebSocket. Accepting and ignoring
is_reconnectis the documented safe choice, identical to the WhatsApp / WeChat pattern.Verification
upstream/main@ 6133285:TypeError: QQAdapter.connect() got an unexpected keyword argument 'is_reconnect'✓upstream/main@ 18e8404.git rev-list --left-right --count upstream/main...HEAD=0 1✓tests/gateway/test_qqbot.pypass on the rebased branch, including 3 new regression tests inTestQQConnectSignature:test_connect_accepts_is_reconnect_true(reconnect path)test_connect_accepts_is_reconnect_false(cold-boot path)test_connect_no_keyword_still_works(backward-compat / default value)QQAdapter,qqbot connect, oris_reconnect kwargkeyword searches against the open PR set.Files Changed
Auto-published by Moonsong via Path B automated pipeline.