fix(qqbot): accept is_reconnect kwarg on QQAdapter.connect - #60590
Closed
Linductor-alkaid wants to merge 1 commit into
Closed
Linductor-alkaid wants to merge 1 commit into
Linductor-alkaid wants to merge 1 commit into
Conversation
The gateway reconnect watcher (gateway/run.py:7784) calls `adapter.connect(is_reconnect=True)` on platforms that dropped after a prolonged outage, so adapters with a server-side update queue can preserve it (NousResearch#46621). `BasePlatformAdapter.connect` already declares the keyword (gateway/platforms/base.py:2864), and ~30 sibling adapters implement the signature. `QQAdapter.connect` was missed during that rollout: its signature still took no arguments, so the keyword-only kwarg crashed with `TypeError: QQAdapter.connect() got an unexpected keyword argument 'is_reconnect'`. On a cold first boot the watcher doesn't pass the flag and the adapter connects fine, but every reconnect attempt after an outage would throw before the WebSocket opened, leaving QQ stuck "disconnected" until the gateway restarted. Accept the kwarg for contract compliance. QQ Bot has no server-side queue concept, so `is_reconnect` does not alter connection behaviour; this is a pure signature fix that aligns the adapter with the abstract contract. No behaviour change. No body changes.
Contributor
Duplicate of #52966 (earliest still-open canonical fix for #52914). This is the same one-line |
Author
|
Closing as a duplicate of #52966, which is the canonical fix for this issue:
Superseded by #52966. Keeping the local branch around in case anything |
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 gateway reconnect watcher (
gateway/run.py:7784) callsadapter.connect(is_reconnect=True)after a prolonged outage so adapters with aserver-side update queue can preserve it (#46621).
BasePlatformAdapter.connectalready declares the keyword (
gateway/platforms/base.py:2864), and ~30 siblingadapters implement the signature.
QQAdapter.connectwas missed during that rollout: its signature still took noarguments, so the keyword-only kwarg crashed with
TypeError: QQAdapter.connect() got an unexpected keyword argument 'is_reconnect'.On a cold first boot the watcher does not pass the flag and the adapter connects
fine, but every reconnect attempt after an outage would throw before the WebSocket
opened, leaving QQ stuck
disconnecteduntil the gateway restarted.Accept the kwarg for contract compliance. QQ Bot has no server-side queue
concept, so
is_reconnectdoes not alter connection behaviour; this is a puresignature fix that aligns the adapter with the abstract contract.
No behaviour change. No body changes.
Diff
Verification (planned before merge)
pytest tests/gateway/test_qqbot.py -qpassesTypeError(is_reconnect=Trueaccepted)Refs #46621