feat(gateway): configurable auto-resume delay for paused platforms - #35938
Closed
courage-zero wants to merge 2 commits into
Closed
feat(gateway): configurable auto-resume delay for paused platforms#35938courage-zero wants to merge 2 commits into
courage-zero wants to merge 2 commits into
Conversation
Adds gateway.platform_resume_delay config option (minutes, default 0)
that controls how long before the gateway automatically resumes a
paused platform after repeated network failures.
When set to a positive value, the circuit breaker still activates
after PAUSE_AFTER_FAILURES consecutive failures, but schedules a
finite next_retry instead of float('inf'). The reconnect watcher
checks the new auto_resume_at field on each tick and auto-resumes
when the timeout expires.
Manually paused platforms (/platform pause) have no auto_resume_at
and stay paused until explicit /platform resume, preserving the
intended semantics of manual pause.
Environment override: HERMES_PLATFORM_RESUME_DELAY (minutes)
Closes NousResearch#35936
Collaborator
Author
|
Closing — upstream already has a better fix (commit 45465b0). Instead of a configurable delay, it removes the auto-pause entirely for retryable failures (network/DNS timeouts). Non-retryable errors like bad auth already drop out of the queue earlier. This is cleaner — no config option needed, self-heals on network recovery within 5 minutes. |
… cleanup auto_resume_at on resume
Contributor
|
Thanks for the recovery-oriented proposal. The reporter’s failure mode is already addressed on current
Closing as implemented on main. |
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.
Closes #35936
Problem
When the gateway loses connection (e.g. Telegram behind Clash/VPN), the circuit breaker pauses the platform permanently after 10 failures. Even after the network recovers, the platform stays paused until manual
/platform resumeorhermes gateway restart.How this differs from #35387
/platform pause, or pause state left from a previous version. Provides a configurable auto-resume mechanism. Recovery.These are complementary: #35387 reduces how often pauses happen, this PR ensures any pause that does happen is self-healing.
Solution
Adds
gateway.platform_resume_delayconfig option (minutes, default0= backward compatible — auto-resume disabled).When
> 0:next_retryinstead offloat(inf)auto_resume_aton each tick and auto-recovers when timeout expires/platform pausedoes NOT setauto_resume_at, preserving manual pause semanticsEnvironment override:
HERMES_PLATFORM_RESUME_DELAY(minutes)Example