fix(server): provider health interval can't drop below 30 seconds #18210
main fromrefs/pull/18210/head·opened View on GitHubProblem#
providerHealthRefreshInterval is copied verbatim by resolveBackgroundActivitySettings, and the two Settings fields (min={0}) persist every keystroke. A saved or patched value such as 5s therefore makes background provider probes run back-to-back. Per the maintainer triage on #12000, probes are not concurrent (makeManagedServerProvider serializes them and the loop is sleep-then-refresh); the defect is only that the interval has no floor.
Fix#
Follows triage items 1, 2 and 4 and nothing else:
MIN_PROVIDER_HEALTH_REFRESH_INTERVAL = 30sin contracts.resolveBackgroundActivitySettings(shared, used by the server and the web client) lifts any positive interval below it to 30s.0still means disabled.- Both fields (Providers → Advanced, Background activity → Advanced) now share
ProviderHealthIntervalField. It keeps a local draft and saves the normalized value (0 or at least 30) once, when the edit commits. Commit happens on blur, on Enter (the field blurs on Enter, because Base UI's NumberField ignores Enter), and when a stepper is released. Arrow keys also commit per the Base UI source; I did not try them in the browser.
Deliberate deviations from the triage suggestion, for maintainer review#
- Floor is 30s, not 90s (
HEALTH_CHECK_TIMEOUT). The triage's cost argument (Antigravity's ~430 MB one-file spawn on every tick) was overtaken by #12008, merged after the triage was written: the periodic Antigravity probe no longer spawns (AntigravityDriver.ts: "The probe must not spawn"). 30s is the step the UI already offers, and the triage allows "a documented minimum". A 90s floor would also raise theperformancepreset (60s), which is a product-default change needing your approval. - Presets are unchanged.
- Skipping ticks while a probe is in flight (triage item 3, marked optional) is not included.
#12470 attempted this earlier and was closed because the provider layer was mid-V2 rewrite. This touches only the shared settings resolver and the two UI fields, not orchestration.
How I checked#
vp test run packages/shared/src/serverSettings.test.ts apps/web/src/components/settings/SettingsPanels.logic.test.ts packages/provider-core/src/server/managedProvider.test.ts: 75 passed. Three of the new tests fail without the resolver change (5s override, legacy 1s flat interval, and the managed-provider refresh loop firing at 1s instead of 30s;TestClock+Deferred, no sleeps).vp fmt --checkandtsc --noEmiton the touched files and packages: no errors.- Interaction in the real UI, both panels (web, isolated dev state in the worktree
.t3). Recording: interval-edit-v2.mp4. Values below are what I read back from the field and from the worktree'ssettings.json:- Providers → Advanced → Health check interval: typed 5 and pressed Enter, and the field showed 30. Increase clicked 3 times: 120. Press-and-hold on Increase, then release: 840, and 840 was saved. After a page reload it still showed 840.
- General → Background activity → Advanced → Provider health interval: typed 5, Enter: 30. Increase clicked 2 times: 90. Hold, then release: 660, and 660 was saved. After a reload and reopening the dialog it still showed 660.
- After typing and before committing,
settings.jsonhad no override, so nothing is saved mid-edit.
- An earlier, shorter clip (blur instead of Enter, no steppers): interval-edit.mp4.
- Static before/after, from a pre-saved 5s override:
Before (main) | After |
|---|---|
![]() | ![]() |
Not checked#
- The recording used a local, uncommitted server patch. On
main, any Background activity write fails before it is saved:requiredScopesForSettingsUpdateinapps/server/src/auth/RpcAuthorization.tsre-decodes an RPC payload that is already decoded, so a Duration fails with "Expected number" and the connection drops. I saw that in the browser onmain. I also reproduced it on a fresh checkout oforigin/main(a1f81a44e5) with a throwaway test: a settings patch carrying a Duration makes the authorization step die with a SchemaError rooted atpatch. It is a separate bug, so it is not fixed here. For the recording only, I replaced that decode with a cast locally, then reverted it; none of it is in this branch. Until it is fixed, this UI write path can't be exercised onmainitself. - Press-and-hold was driven with synthetic pointer events (pointerdown, a 1.5–1.8s wait, pointerup dispatched on the Increase button), not a physical mouse. The value ran well past one step while held and the released value was saved. I did not reproduce the pre-fix failure on the old code.
- Of the video, I looked at the first frame and at screenshots taken during the run, not every frame.
- Web only. Desktop wraps the same panels; mobile does not expose this setting.
Closes #12000
Claude Sonnet 5.5 via Claude Code in T3 Code
🤖 Generated with Claude Code
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:M
- @@ -1008,4 +1009,4 @@10081009 step={PROVIDER_HEALTH_INTERVAL_STEP_SECONDS}10091010 size="sm"10101011 className="w-32"1011- onValueChange={(value) =>1012+ onValueCommitted={(value) =>
🟡 Medium
settings/SettingsPanels.tsx:1012Holding Increase on a saved 600-second provider health interval repeatedly uses the unchanged controlled value, so release saves only 630 seconds instead of accumulating steps; the display also snaps back to 600 during the hold. Since this field only persists through
onValueCommittedand has no draft state updated byonValueChange, keep a local draft and persist that draft on commit.🤖 Copy this AI Prompt to have your agent fix this:
In file @apps/web/src/components/settings/SettingsPanels.tsx around line 1012: Holding Increase on a saved 600-second provider health interval repeatedly uses the unchanged controlled value, so release saves only 630 seconds instead of accumulating steps; the display also snaps back to 600 during the hold. Since this field only persists through `onValueCommitted` and has no draft state updated by `onValueChange`, keep a local draft and persist that draft on commit. Approvability#
Verdict: Would Approve
Macroscope's review found this PR approvable — This is a contained bug fix that clamps only sub-30-second provider health intervals while preserving existing defaults, disabled behavior, and valid settings, with server and UI tests covering the change. A separate unresolved Medium correctness finding remains subject to the repository’s blocking correctness gate.
Not approved because:
- 1 blocking correctness issue found at or above your repo's Minimum Blocking Severity
Note
This comment is posted by Julius' dot
Closing for missing interaction verification. The screenshots show a pre-saved 5-second interval becoming 30 seconds, but the PR says typing and committing a value was not checked. The normalization test does not exercise the changed NumberField interaction. Add a short recording showing editing, committing and reloading the interval in both settings panels, then request reconsideration.
juliusmarminge closed this
Requesting reconsideration. The missing interaction evidence is now in the PR description.
Recording: interval-edit.mp4. In both Providers → Advanced and General → Background activity → Advanced, it shows typing 5 into the interval field, blurring to commit, the field clamping to 30, and a page reload still showing 30. The 30s value was also confirmed in the dev worktree's
settings.json.Macroscope finding (real, fixed): the fields were controlled by the saved value with no draft, so holding a stepper recomputed from the unchanged value. Both panels now use one shared
ProviderHealthIntervalFieldthat keeps a local draft and saves the normalized value once on commit: 465659e. The closed PR does not show this commit yet; it is onfix/provider-health-interval-floor.One thing you should know: on current
main, any Background activity write fails before it saves.requiredScopesForSettingsUpdate(apps/server/src/auth/RpcAuthorization.ts) re-decodes an already-decoded RPC payload, so a Duration hits "Expected number" and the connection drops. That is a separate bug that I did not fix here. For the recording only, I replaced that decode with a cast locally and reverted it; it is not in this branch. Not checked: press-and-hold on a stepper, and Enter to commit (blur works). Details are under "Not checked" in the description.Update, since the first recording missed some gaps. New commit 0feabc5 on
fix/provider-health-interval-floor(this closed PR still shows head dd1529a).- Enter did not commit. Base UI's NumberField ignores Enter, so after the draft change typing a value and pressing Enter no longer saved it. Enter now blurs the field, which commits.
- New recording: interval-edit-v2.mp4. In both Settings panels it shows typing 5 then Enter (30), repeated Increase clicks, a press-and-hold (driven with synthetic pointer events, not a physical mouse), and the value surviving a reload.
- The PR description now lists what I checked and what I did not. That includes the recording using a local server patch for the existing Background activity write failure on
main, which I reproduced again onorigin/mainand did not fix here.
Sign in to join this conversation.


macroscopeapp[bot](GitHub profile, opens in a new tab) reviewed