Conversation
The v0.18.0 refactor (7c1a029) added a keyword-only `is_reconnect: bool = False` argument to `BasePlatformAdapter.connect()` so the gateway's reconnect watcher can ask adapters to preserve their server-side update queue when re-establishing a dropped platform. `QQAdapter.connect()` was not updated in the same release, so the watcher's call raises `TypeError` on every reconnect attempt and the QQBot platform enters a permanent fatal-error state on v0.18.0 + a network blip — confirmed on a fresh v0.18.0 install where QQBot auto-failed to start after the platform was added with `is_reconnect` semantics. QQ Bot has no server-side update queue to preserve (every message is pushed live over the WebSocket), so the flag is accepted and intentionally ignored. Default is `False` to keep cold-start behavior identical to v0.17.x. Mirrors the same `is_reconnect` pattern already adopted by other adapters in this release.
Contributor
Duplicate of #52966 — same one-line fix adding the keyword-only |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The v0.18.0 refactor (commit 7c1a029) added a keyword-only
is_reconnect: bool = Falseargument toBasePlatformAdapter.connect()so the gateway's reconnect watcher can ask adapters to preserve their server-side update queue when re-establishing a dropped platform.QQAdapter.connect()ingateway/platforms/qqbot/adapter.pywas not updated in the same release, so every reconnect attempt raises:The QQBot platform then enters the watchdog's fatal-error state and can never come back, even on a fresh v0.18.0 install.
Rationale
The contract docstring on
BasePlatformAdapter.connect()says:QQ Bot has no server-side update queue — every inbound message is pushed live over the WebSocket — so the flag is accepted and intentionally ignored, mirroring the same pattern already used by the other adapters in this release.
Diff
One-file change in
gateway/platforms/qqbot/adapter.py:Falsepreserves cold-start behavior identical to v0.17.xVerification
Applied this patch on top of v0.18.0 (local checkout
30e947e0+1af7d6580ahead). After bringing the gateway back up:tail ~/.hermes/logs/gateway.logshowsConnected~/.hermes/gateway_state.jsonhasqqbot.state == "online"TypeError: ... is_reconnectStatic checks performed on the same VPS:
py_compileof modifiedadapter.pyinspect.signature(QQAdapter.connect)matches abstract signature(self, *, is_reconnect: bool = False) -> boolis_reconnectparameter isKEYWORD_ONLYwith defaultFalseawait adapter.connect(is_reconnect=True)reaches end of function (no TypeError)Reproduction
After applying this patch the same sequence produces a stable
Connectedstate and the reconnect watcher can no longer crash the platform.