feat: Add provider health and per-provider controls#1289
feat: Add provider health and per-provider controls#1289huxcrux wants to merge 8 commits intopingdotgg:mainfrom
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Changed this PR from modifying settings (after the settings change where merged) to only focus on provider health/controls instead |
c0aedc6 to
ed8c49b
Compare
| activeProviderStatus !== undefined && | ||
| activeProviderStatus.status === "ready" && | ||
| activeProviderStatus.available && | ||
| activeProviderStatus.authStatus === "authenticated"; |
There was a problem hiding this comment.
Dropdown chevron hidden during initial status loading
Low Severity
showActiveProviderChevron requires activeProviderStatus !== undefined and status "ready" with "authenticated" auth. Before provider statuses load (empty array on initial render), activeProviderStatus is undefined, so the chevron is always hidden on first render. It's also hidden for "warning" status with "unknown" auth, even though isProviderUsable considers those providers usable. This creates a visual inconsistency where a usable provider's dropdown indicator disappears.
| </p> | ||
| ) : null} | ||
| </div> | ||
| ) : null} |
There was a problem hiding this comment.
Redundant nested null-check for error display
Low Severity
refreshProviderStatusesError is checked in the outer conditional (line 1061) and then redundantly checked again in an identical inner conditional (line 1063). Since React state doesn't change within a single render, the inner check is always true when the outer check passes, making the nested conditional dead code.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 3 total unresolved issues (including 2 from previous reviews).
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
|
|
||
| const child = spawn("codex", ["app-server"], { | ||
| stdio: ["pipe", "pipe", "ignore"], | ||
| shell: process.platform === "win32", |
There was a problem hiding this comment.
App-server probe bypasses ChildProcessSpawner service abstraction
Medium Severity
readCodexAccountPlanViaAppServer uses Node's raw spawn from node:child_process instead of the Effect ChildProcessSpawner service that every other CLI invocation in the provider layer uses. This breaks the service abstraction: when checkCodexProviderStatus falls back to this function (when parsed.plan is absent), it spawns an actual codex app-server process that cannot be intercepted by the test mock spawner. In CI or test environments this could spawn real processes and make network calls unexpectedly.


What Changed
Added provider health visibility and per-provider enablement across Settings and provider selection.
Why
As more providers are added, provider availability needs to be explicit and predictable across the app.
This change makes provider health visible in one place, gives users a direct way to disable providers individually, and ensures the picker only allows selecting providers that are actually usable.
UI Changes
Added aa few extra pictures to show the different states when a provider is not found, unauthed or working fine.
Provider picker:
Settings:
Checklist
Note
Add provider health controls, per-provider enable/disable, and login/logout to settings
ProviderHealthservice withrefreshStatuses,refreshStatus,login, andlogoutmethods; adds four matching WebSocket methods (serverRefreshProviderStatuses,serverRefreshProviderStatus,serverProviderLogin,serverProviderLogout) wired through the server and native API client.planandversionfields toServerProviderStatus, fetching the Codex plan via a short-lived app-server session when not available in auth output.enabledProviderstoAppSettingsSchema(defaults bothcodexandclaudeAgenttotrue) withisProviderEnabled,getEnabledProviderOptions, andpatchProviderEnabledhelpers.ChatViewwhen the selected provider is disabled, not installed, or unauthenticated, showing an inline warning banner with an Open Settings link.ProviderModelPickerto reflect per-provider usability: disables unusable options, adds status labels, and changes styling for an unusable active provider.getStatusesnow reads from a cachedRefupdated by explicit refresh calls rather than a startup-time fiber; callers that relied on the old snapshot behavior will see stale data until a refresh is triggered.Macroscope summarized 44cb513.
Note
Medium Risk
Adds new WebSocket RPCs that execute provider CLIs (refresh/login/logout) and changes provider status resolution/caching, which can affect UX and correctness of provider readiness reporting across the app.
Overview
Adds end-to-end provider health visibility and controls: provider statuses now include optional
planandversion, are cached in theProviderHealthservice, and can be refreshed (all or per-provider) as well as triggered tologin/logout.Introduces per-provider enablement in persisted settings (
enabledProviders) and updates chat UI/pickers to block sending and prevent selecting disabled/unavailable/unauthenticated providers, surfacing actionable errors and a Settings shortcut.Extends contracts + WebSocket server/native API with new RPC methods (
server.refreshProviderStatuses,server.refreshProviderStatus,server.providerLogin,server.providerLogout) and updates health probing to parse auth JSON more robustly (sharedauthProbe) with a Codex plan fallback via an app-serveraccount/readprobe. Also removes per-clientgit.actionProgresspublishing fromgitRunStackedActionrouting and adjusts tests accordingly.Written by Cursor Bugbot for commit 44cb513. This will update automatically on new commits. Configure here.