Skip to content

fix: notify gateway when QQ bot adapter exhausts reconnect attempts#15510

Open
vominh1919 wants to merge 2 commits into
NousResearch:mainfrom
vominh1919:fix/qqbot-notify-fatal-error
Open

fix: notify gateway when QQ bot adapter exhausts reconnect attempts#15510
vominh1919 wants to merge 2 commits into
NousResearch:mainfrom
vominh1919:fix/qqbot-notify-fatal-error

Conversation

@vominh1919

Copy link
Copy Markdown
Contributor

Fixes #15490

Problem

When the host network goes down, the QQ bot adapter silently dies during WebSocket reconnect. The gateway never learns the adapter failed and cannot restart it.

Root Cause

_listen_loop has 5 exit paths that return without calling _notify_fatal_error(). Compare with Telegram adapter which correctly calls both _set_fatal_error() + _notify_fatal_error() on all exit paths.

Fix

All 5 exit paths now call _set_fatal_error() + _notify_fatal_error() before returning, matching the Telegram adapter pattern.

Files Changed

  • gateway/platforms/qqbot/adapter.py — 20 lines added

Add shutdown guard to sync_turn() and defense-in-depth loop.is_closed()
check in _run_sync() to prevent RuntimeError during interpreter teardown.

Fixes NousResearch#15497
_listen_loop had 5 exit paths that returned without calling
_notify_fatal_error(), leaving the adapter as a zombie in the gateway.
The gateway never learned the adapter died and could not restart it.

Now all exit paths call _set_fatal_error() + _notify_fatal_error()
so the gateway can trigger recovery (same pattern as Telegram adapter).

Fixes NousResearch#15490
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists platform/qqbot QQ Bot adapter comp/gateway Gateway runner, session dispatch, delivery labels Apr 25, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Likely duplicate of #14565 — both add _set_fatal_error()/_notify_fatal_error() to QQBot _listen_loop exit paths for #14539. Also overlaps with #15051.

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 P2 Medium — degraded but workaround exists platform/qqbot QQ Bot adapter type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

qqbot adapter silently dies on network outage during reconnect; gateway has no task watchdog

2 participants