Skip to content

fix(qqbot): accept is_reconnect kwarg in connect() to match base class - #60831

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

fix(qqbot): accept is_reconnect kwarg in connect() to match base class#60831
Mayrixon wants to merge 1 commit into
NousResearch:mainfrom
Mayrixon:fix/qqbot-connect-is-reconnect

Conversation

@Mayrixon

@Mayrixon Mayrixon commented Jul 8, 2026

Copy link
Copy Markdown

Summary

Commit 43b8ba4181 (fix #46621, 2026-06-25) added an is_reconnect keyword argument to BasePlatformAdapter.connect(), and GatewayRunner._connect_adapter_with_timeout now passes it to every adapter. However, QQAdapter overrides connect() with the old narrow signature:

async def connect(self) -> bool:

This causes every cold-boot and reconnect attempt to fail with:

QQAdapter.connect() got an unexpected keyword argument 'is_reconnect'

The QQ bot is stuck in an infinite reconnect loop (88+ attempts logged in one session).

Fix

Accept the is_reconnect keyword-only argument with default False to match the base class contract:

async def connect(self, *, is_reconnect: bool = False) -> bool:

The QQ adapter does not maintain a server-side update queue, so the flag is ignored — same pattern as webhook, signal, whatsapp_cloud, and other adapters that were correctly updated in the original commit.

Testing

  • Gateway reconnect loop no longer throws TypeError for qqbot
  • No behavioral change — is_reconnect is accepted and ignored

Commit 43b8ba4 (fix NousResearch#46621) added is_reconnect to
BasePlatformAdapter.connect() and the gateway runner now passes it to
every adapter. QQAdapter overrode connect() with the old narrow
signature async def connect(self) -> bool:, causing:

  QQAdapter.connect() got an unexpected keyword argument 'is_reconnect'

on every cold-boot and reconnect attempt.

Accept the kwarg (keyword-only, default False) to match the base class
contract. The adapter does not maintain a server-side update queue so
the flag is ignored.
@alt-glitch alt-glitch added type/bug Something isn't working comp/gateway Gateway runner, session dispatch, delivery platform/qqbot QQ Bot adapter sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages duplicate This issue or pull request already exists P2 Medium — degraded but workaround exists labels Jul 8, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Duplicate of #52966 (earliest still-open fix for the same one-line is_reconnect signature gap in QQAdapter.connect()). This is a saturated cluster of identical fixes for #52914 (#52966/#53540/#53546/#53948/#54029/#54037/#54165/#58341); #52966 is canonical since the earlier anchor #52922 is closed unmerged. The fix is confirmed still absent on main (bare async def connect(self) -> bool).

@teknium1

Copy link
Copy Markdown
Contributor

Thanks for the focused QQBot contract fix.

This automated hermes-sweeper review found that the exact behavior is already on current main via merged PR #61767:

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.

Telegram gateway discards the server-side update queue on watcher reconnect after a prolonged outage (start_polling drop_pending_updates=True)

3 participants