fix(qqbot): retry gateway URL fetch with cache fallback#17256
Open
dwc1997 wants to merge 1 commit into
Open
Conversation
Collaborator
|
Appears to be a resubmission of closed #17240 (same retry + cache fallback approach for QQ gateway URL). Maintainer should verify this supersedes it cleanly. |
Author
Thanks for calling this out.
This PR keeps the same core fix (bounded retry + cached gateway URL fallback), is rebased on current |
2 tasks
Add bounded retries when resolving the QQ WebSocket gateway URL, cache the last successful URL, and fall back to it on transient failures. Align gateway URL tests with the qqbot.adapter module path for asyncio.sleep patching.
a33505c to
9f8c1e6
Compare
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.
Add bounded retries when resolving the QQ WebSocket gateway URL, cache the last successful URL, and fall back to it on transient failures. Align gateway URL tests with the
qqbot.adaptermodule path forasyncio.sleeppatching.What does this PR do?
QQ’s WebSocket reconnect path resolves the gateway URL via the REST
/gatewayendpoint. When that call fails transiently, reconnect could fail even though a recently valid gateway URL was already known.This PR hardens
_get_gateway_url()by:GATEWAY_URL_RETRY_DELAYS).Tests cover retry-then-success and cache-fallback behavior.
asyncio.sleepis patched atgateway.platforms.qqbot.adapter.asyncio.sleepto match the refactored module layout.Related Issue
Fixes #11493
Type of Change
Changes Made
gateway/platforms/qqbot/constants.py— addGATEWAY_URL_RETRY_DELAYS.gateway/platforms/qqbot/adapter.py— retry + cache + fallback in_get_gateway_url()while preserving existing headers (includingUser-Agent).tests/gateway/test_qqbot.py— addTestGatewayUrlFetchregression tests; fixasyncio.sleeppatch target for the qqbot adapter package path.How to Test
Run:
Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/AFor New Skills
hermes --toolsets skills -q "Use the X skill to do Y"Screenshots / Logs