fix(qqbot): accept is_reconnect kwarg in connect() to fix reconnection loop - #54037
fix(qqbot): accept is_reconnect kwarg in connect() to fix reconnection loop#54037danbao wants to merge 1 commit into
Conversation
…n loop The gateway reconnection watcher calls adapter.connect(is_reconnect=True) on failed platforms, but QQAdapter.connect() did not accept this parameter, causing every reconnect attempt to fail with: QQAdapter.connect() got an unexpected keyword argument 'is_reconnect' All other platform adapters (weixin, signal, api_server, bluebubbles, webhook, whatsapp_cloud, yuanbao, msgraph_webhook) already accept is_reconnect. This one-line fix brings QQBot in line with the BasePlatformAdapter.connect() contract.
Duplicate of #52922 (the earliest open canonical fix for #52914). This PR makes the identical one-line |
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary
Verdict: Approved
Adds is_reconnect keyword argument to QQAdapter.connect() to match the BasePlatformAdapter.connect contract. The gateway reconnect loop calls connect(is_reconnect=True) on every reconnect attempt, so every adapter must accept it. Without this fix, QQ reconnection raised TypeError: unexpected keyword argument 'is_reconnect'. Test verifies the signature accepts the kwarg and that the reconnect call path doesn't raise TypeError.
Reviewed by Hermes Agent
|
Encountered the same issue on v0.18.0 — QQ bot goes into infinite retry loop after any gateway restart with . Applied this same one-line fix locally, restarted gateway, and QQ bot reconnects successfully. Can confirm this PR resolves the problem. |
|
Thanks for the focused QQBot reconnect fix. The exact behavior is already implemented on current
This supersedes the duplicate fix cluster noted in the prior discussion. |
Problem
The gateway reconnection watcher calls
adapter.connect(is_reconnect=True)on failed platforms (gateway/run.py L3176), butQQAdapter.connect()does not accept this keyword argument. This causes every reconnect attempt to fail with:The watcher retries with exponential backoff (60s → 120s → 240s → 300s) indefinitely, filling the log with errors.
Root Cause
QQAdapter.connect()(line 281) has signatureasync def connect(self) -> bool:— missing theis_reconnectparameter thatBasePlatformAdapter.connect()defines and all other platform adapters implement:is_reconnectFix
One-line change: add
*, is_reconnect: bool = Falseto match the base class contract.Verification
No more reconnection loop in gateway.log.