fix(qqbot): accept gateway reconnect flag - #59353
Conversation
Match the BasePlatformAdapter.connect(is_reconnect=...) contract so QQBot can be started by the gateway reconnect path. Add a regression test that calls QQAdapter.connect(is_reconnect=True).
Duplicate of #52966 — identical one-line fix adding the keyword-only |
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary
Verdict: Approved
Changes
Updates QQAdapter.connect() to accept is_reconnect: bool = False keyword argument for compatibility with the gateway's common PlatformAdapter.connect() contract. QQBot manages resume vs. cold identify internally from stored session state. Also adds a dedicated regression test.
Quality
- Clean contract alignment: matches the base class signature
- Well-documented with docstring explaining how QQBot handles the flag internally
- Regression test covers the exact call pattern gateway.run uses
Suggestions
- None
Reviewed by Hermes Agent
tonydwb
left a comment
There was a problem hiding this comment.
Code Review
COMMENT: fix(qqbot): accept gateway reconnect flag
Small fix (21 additions, 2 deletions). No security concerns.
Reviewed by Hermes Agent
|
I hit the same regression on a live Hermes gateway with QQBot enabled after updating to current The local gateway state showed Telegram/Discord connected while QQBot remained retrying with that error. I independently tested the same minimal fix locally and this PR is the cleaner version of it: QQBot accepts the gateway reconnect kwarg without changing its QQ auth/WebSocket behavior. Additional local validation I ran: I opened a duplicate PR while debugging (#61356) and closed it in favor of this one. |
|
The official reconnect-contract fix has now landed via #61767, which includes the QQBot regression fix and repository-wide adapter contract coverage. Closing this duplicate now that upstream main contains the fix. Thank you. |
Summary
connect(is_reconnect=...)keyword argumentQQAdapter.connect(is_reconnect=True)Why
GatewayRunner now forwards
is_reconnectthrough_connect_adapter_with_timeout()to every adapter. QQBot still exposedconnect(self), so gateway startup/reconnect failed before it could open the QQ websocket:Test Plan
python3 -m pytest tests/gateway/test_qqbot.py::TestVoiceAttachmentSSRFProtection::test_connect_accepts_gateway_reconnect_flag -q -o 'addopts='python3 -m pytest tests/gateway/test_qqbot.py -q -o 'addopts='