Skip to content

fix(qqbot): accept is_reconnect kwarg + zombie detection + heartbeat optimization - #59734

Open
jamesxia1988 wants to merge 1 commit into
NousResearch:mainfrom
jamesxia1988:fix/qqbot-connect-signature
Open

fix(qqbot): accept is_reconnect kwarg + zombie detection + heartbeat optimization#59734
jamesxia1988 wants to merge 1 commit into
NousResearch:mainfrom
jamesxia1988:fix/qqbot-connect-signature

Conversation

@jamesxia1988

@jamesxia1988 jamesxia1988 commented Jul 6, 2026

Copy link
Copy Markdown

Problem

Upstream commit 43b8ba4 added is_reconnect keyword argument to all platform connect() calls in gateway/run.py, but the QQBot adapter was never updated to accept this parameter. This causes TypeError: QQAdapter.connect() got an unexpected keyword argument 'is_reconnect' on every reconnect attempt after a WebSocket drop.

Additionally, QQBot connections are dropped every ~30 minutes by the server (code=4009 Session timed out) despite heartbeats. The upstream heartbeat interval (80% of server interval) is not aggressive enough.

Fix

  1. Accept is_reconnect kwarg in QQAdapter.connect() to match the base class signature
  2. Zombie connection detection: close WS if no server events for 5 minutes
  3. More aggressive heartbeat: reduce from 80% to 50% of server interval
  4. Mark alive on heartbeat ACK: prevent false zombie detection on healthy idle connections
  5. Add Chinese error keywords (无权限/权限不足) to retryable error list

Related

@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 P2 Medium — degraded but workaround exists duplicate This issue or pull request already exists labels Jul 6, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Duplicate of #52966 -- the earliest still-open canonical fix for this QQBot is_reconnect reconnect regression (bug #52914). This is an identical one-line signature fix; the cluster already includes open PRs #58128 and #59429. Marking as duplicate for triage bookkeeping; a maintainer picks which to merge.

…optimization

- Add is_reconnect keyword arg to connect() to match base class signature
  (upstream 43b8ba4 added this to run.py but forgot to update qqbot adapter)
- Add zombie connection detection: close WS if no server events for 5 min
- Reduce heartbeat interval from 80% to 50% of server interval for more
  aggressive keepalive (QQ server has ~30min session timeout)
- Update heartbeat ACK to mark alive so zombie detector doesn't fire on
  healthy-but-idle connections
- Add Chinese error keywords (无权限/权限不足) to retryable error list

fix(web_tools): fall through to httpx fallback for search-only backends
- When configured backend is search-only (ddgs), fall through to active
  extract provider or httpx extraction instead of returning an error
@jamesxia1988 jamesxia1988 changed the title fix(qqbot): accept is_reconnect kwarg in connect() fix(qqbot): accept is_reconnect kwarg + zombie detection + heartbeat optimization Jul 7, 2026
@jamesxia1988
jamesxia1988 force-pushed the fix/qqbot-connect-signature branch from 6ea7613 to d06e8f0 Compare July 7, 2026 13:31
@teknium1 teknium1 added sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform labels Jul 15, 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:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades 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.

fix(qqbot): QQAdapter.connect() missing is_reconnect parameter — TypeError on reconnect

3 participants