fix(server): honor disabled usage hub polling - #10310
Open
yashranaway wants to merge 1 commit into
Open
yashranaway wants to merge 1 commit into
yashranaway wants to merge 1 commit into
Conversation
Contributor
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a narrowly scoped server bug fix that makes the existing disabled polling setting suppress only scheduled usage-hub refreshes, while preserving startup, settings-change, explicit refresh, and enabled polling behavior. Deterministic tests cover both disabled and enabled intervals. You can add or adjust custom eligibility rules. Learn more. |
This branch has not been deployed
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 Changed
Skip periodic usage hub refreshes when the provider health-check interval is disabled. Startup, settings changes, and explicit refresh still fetch the current limits.
Why
An interval of zero still polls configured CLIProxyAPI usage hubs once per minute while the Limits view is active. The loop substitutes a one-minute sleep, then fetches anyway.
Testing
UsageLimitSources.test.tspasses, 2/2.Checklist
Model: GPT-6 Astra
Harness: T3 code
Note
Fix 'UsageLimitSources.make' to honor disabled polling for non-positive intervals
UsageLimitSources.makenow skips scheduled provider-status refreshes when the configured interval is zero or negative. It retains a 60-second sleep to avoid tight looping but skips theBackgroundPolicycheck.BackgroundPolicyfixture and parameterized tests to verify read counts for zero and one-minute refresh intervals.0or a negative value now disables scheduled polling instead of falling back to periodic refreshes.Macroscope summarized 2c566bd.