Skip to content

fix(server): honor disabled usage hub polling - #10310

Open
yashranaway wants to merge 1 commit into
pingdotgg:mainfrom
yashranaway:fix/disable-hub-health-polling
Open

yashranaway wants to merge 1 commit into
pingdotgg:mainfrom
yashranaway:fix/disable-hub-health-polling

Conversation

@yashranaway

@yashranaway yashranaway commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

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.ts passes, 2/2.
  • Deterministic TestClock cases cover enabled and disabled polling and explicit refresh.
  • Server typecheck, targeted lint, and formatting pass.

Checklist

  • One focused change
  • Explained what changed and why
  • Added regression coverage for the changed behavior
  • No UI layout or animation changes

Model: GPT-6 Astra
Harness: T3 code

Note

Fix 'UsageLimitSources.make' to honor disabled polling for non-positive intervals

  • UsageLimitSources.make now 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 the BackgroundPolicy check.
  • The initial forked refresh and explicit refresh requests remain unchanged.
  • Adds a test-only BackgroundPolicy fixture and parameterized tests to verify read counts for zero and one-minute refresh intervals.
  • Behavioral Change: Setting the refresh interval to 0 or a negative value now disables scheduled polling instead of falling back to periodic refreshes.

Macroscope summarized 2c566bd.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Sep 6, 2026
@macroscopeapp

macroscopeapp Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 2c566bd

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

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant