fix(yuanbao): restore active singleton after WS reconnect - #58378
Closed
liuhao1024 wants to merge 1 commit into
Closed
fix(yuanbao): restore active singleton after WS reconnect#58378liuhao1024 wants to merge 1 commit into
liuhao1024 wants to merge 1 commit into
Conversation
_do_reconnect() succeeded but never called YuanbaoAdapter.set_active(adapter), leaving get_active() permanently returning None after any WS disconnect/reconnect cycle. This caused cron delivery to silently fail because _send_yuanbao() checks get_active_adapter() and gives up immediately when it returns None. Fix: call set_active(adapter) after successful reconnect, matching the pattern in connect(). Fixes NousResearch#58363
This was referenced Jul 4, 2026
13 tasks
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.
What does this PR do?
Fixes a bug where Yuanbao cron delivery silently fails after any WS disconnect/reconnect cycle. The
_do_reconnect()method successfully reconnects but never callsYuanbaoAdapter.set_active(adapter), leavingget_active_adapter()permanently returningNone. This causes_send_yuanbao()insend_message_tool.pyto fail immediately with "Yuanbao adapter is not running" on every subsequent cron delivery attempt.Related Issue
Fixes #58363
Type of Change
Changes Made
gateway/platforms/yuanbao.py: AddedYuanbaoAdapter.set_active(adapter)call in_do_reconnect()after successful reconnect, matching the pattern already used inconnect().tests/test_yuanbao_reconnect_set_active.py: Added regression tests verifying thatget_active_adapter()returns the adapter after successful reconnect and remainsNoneafter failed reconnect.How to Test
deliverpointing at Yuanbao.pytest tests/test_yuanbao_reconnect_set_active.py -v— both tests should pass.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/AScreenshots / Logs
The fix is a single line addition that restores the active singleton after reconnect:
This matches the existing pattern in
connect()(line 3377) anddisconnect()(line 5189, which callsset_active(None)).