fix(gateway): auto-recover auto-paused platforms after transient failures#35290
Open
liuhao1024 wants to merge 1 commit into
Open
fix(gateway): auto-recover auto-paused platforms after transient failures#35290liuhao1024 wants to merge 1 commit into
liuhao1024 wants to merge 1 commit into
Conversation
…ures The circuit breaker pauses platforms after 10 consecutive failures, but never attempts to reconnect them. When the underlying issue (e.g., DNS outage) is transient, the adapter stays permanently paused until the user manually runs /platform resume or restarts the gateway. Add auto-recovery logic: auto-paused platforms (circuit breaker) get a single reconnection attempt every 5 minutes. If the attempt succeeds, the platform reconnects normally. If it fails, it stays in the retry queue with normal backoff. Manually paused platforms (/platform pause) are not affected — they still require explicit /platform resume. Fixes NousResearch#35284
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?
Adds auto-recovery for auto-paused platforms (circuit breaker). When a platform is paused after 10 consecutive failures (e.g., due to a transient DNS outage), the reconnect watcher now attempts a single reconnection every 5 minutes. If the underlying issue has resolved, the platform reconnects automatically without manual intervention.
Related Issue
Fixes #35284
Type of Change
Changes Made
gateway/run.py: Addpause_modetracking (autovsmanual) to_pause_failed_platform(), auto-recovery logic in_platform_reconnect_watcher(), and cleanup in_resume_paused_platform(). Manual pauses (/platform pause) are not affected.tests/gateway/test_platform_reconnect.py: Add 4 tests for auto-recovery behavior (auto-paused recovers after interval, manual stays paused, not recovered before interval, failure re-queues). Update existing paused-platform test to setpause_mode="manual".How to Test
python3 -m pytest tests/gateway/test_platform_reconnect.py -q— all 35 tests should pass/platform pause telegramand verify it does NOT auto-recoverChecklist
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/ACode Intelligence
gateway/run.py:_platform_reconnect_watcher,gateway/run.py:_pause_failed_platform,gateway/run.py:_resume_paused_platform