Skip to content

fix(qqbot): 补齐 connect() is_reconnect 参数签名 / fix QQAdapter.connect() missing is_reconnect param - #61309

Closed
WenhuaXia wants to merge 1 commit into
NousResearch:mainfrom
WenhuaXia:fix/qqbot-connect-is-reconnect
Closed

fix(qqbot): 补齐 connect() is_reconnect 参数签名 / fix QQAdapter.connect() missing is_reconnect param#61309
WenhuaXia wants to merge 1 commit into
NousResearch:mainfrom
WenhuaXia:fix/qqbot-connect-is-reconnect

Conversation

@WenhuaXia

Copy link
Copy Markdown

摘要 / Summary

commit 43b8ba4 (Jun 25) 在 _connect_adapter_with_timeout() 中引入了 is_reconnect 参数并转发到 adapter.connect()。基类 BasePlatformAdapter.connect() 和所有其他平台 adapter(telegram, feishu, weixin, dingtalk, wecom 等)都已实现该参数签名,但 QQAdapter 遗漏了,导致 QQBot 启动时 TypeError。

commit 43b8ba4 (Jun 25) introduced the is_reconnect kwarg in _connect_adapter_with_timeout() and forwarded it to adapter.connect(). The base class BasePlatformAdapter.connect() and every other platform adapter (telegram, feishu, weixin, dingtalk, wecom, etc.) already implement this signature — but QQAdapter was missed, causing QQBot to crash on startup with a TypeError.

错误 / Error

✗ qqbot error: QQAdapter.connect() got an unexpected keyword argument 'is_reconnect'

修复 / Fix

一行改动:在 QQAdapter.connect() 签名中补齐 *, is_reconnect: bool = False

One-line fix: add *, is_reconnect: bool = False to QQAdapter.connect() signature.

影响 / Impact

  • QQBot 在所有 0.17.0+ 版本中无法启动(启动后立即断开)
  • QQBot cannot start on any 0.17.0+ release (disconnects immediately on boot)

…missing is_reconnect param

commit 43b8ba4 added is_reconnect kwarg to _connect_adapter_with_timeout()
and forwarded it to adapter.connect(). BasePlatformAdapter.connect() already
accepts it, and every other platform adapter (telegram, feishu, weixin, etc.)
implemented the override — except QQAdapter which was missed.

This caused QQBot to fail on startup with:
  TypeError: QQAdapter.connect() got an unexpected keyword argument 'is_reconnect'

Fix: add is_reconnect: bool = False to QQAdapter.connect() signature.
@alt-glitch alt-glitch added type/bug Something isn't working comp/gateway Gateway runner, session dispatch, delivery platform/qqbot QQ Bot adapter P2 Medium — degraded but workaround exists sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages duplicate This issue or pull request already exists labels Jul 9, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Duplicate of #52966 — byte-identical one-line signature fix adding the keyword-only is_reconnect: bool = False param to QQAdapter.connect() (gateway/platforms/qqbot/adapter.py), matching the BasePlatformAdapter.connect() contract and gateway/run.py's reconnect watcher. #52966 is the earliest still-OPEN canonical fix for issue #52914 (the truly-earliest #52922 is CLOSED/unmerged, so not a valid dup anchor). This is a saturated dup cluster (#58607/#58758/#61298 etc.). Related: #52914 (issue).

@teknium1

Copy link
Copy Markdown
Contributor

Thanks for the focused QQBot fix.

Automated hermes-sweeper review found that this exact reconnect-contract guarantee is already implemented on current main:

  • gateway/platforms/qqbot/adapter.py:281 now accepts *, is_reconnect: bool = False.
  • Merged PR fix(gateway): enforce reconnect contract across adapters #61767 included the canonical QQ fix in commit fcbea031f47f8c30d022ffb1461b3a44075328cb.
  • tests/gateway/test_qqbot.py:193 covers both default and is_reconnect=True calls; tests/gateway/test_adapter_connect_is_reconnect_contract.py:126 prevents the adapter-wide regression class.

Closing as implemented on main.

@teknium1 teknium1 closed this Jul 10, 2026
@teknium1 teknium1 added the sweeper:implemented-on-main Sweeper: behavior already present on current main label Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery duplicate This issue or pull request already exists P2 Medium — degraded but workaround exists platform/qqbot QQ Bot adapter sweeper:implemented-on-main Sweeper: behavior already present on current main sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants