🤖 feat: enable/disable providers without removing API keys#2329
🤖 feat: enable/disable providers without removing API keys#2329ibetitsmike merged 9 commits intomainfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e5649b37df
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c1af1109ca
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. You're on a roll. ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
|
Thanks for this! |
Summary
Add per-provider enable/disable toggles that let users turn off AI providers without deleting their saved API keys or credentials. The enabled state persists server-side in
providers.jsoncand is enforced at both the backend (request-time) and frontend (UI gating) layers.Background
Addresses #2034. Users debugging provider issues or isolating behavior need a way to temporarily deactivate providers. Previously, the only way was to delete the API key, which is destructive and requires re-entry.
Implementation
Backend
providerService.ts: Readsenabledfield from raw JSONC, computesisEnabledandisConfigured. Disabled providers surface as not configured in the UI. BothsetConfig()andsetConfigValue()normalize theenabledkey (storesfalseas boolean, deletes on re-enable).providerModelFactory.ts: Early guard increateModel()returnsprovider_disablederror when a non-gateway provider is disabled. Gateway bypass is preserved — disabled providers are still accessible via Mux Gateway if allowlisted.voiceService.ts: Checks OpenAI enabled state before transcription to prevent unexpected API calls.isProviderDisabledInConfig()centralizes the enabled check, handling both booleanfalseand string"false"(manual JSONC edits).Frontend
openAIProviderEnabledstate for voice input keybind gating.Error Plumbing
provider_disableddiscriminant inSendMessageErrorSchemaSchema
isEnabled: z.boolean().default(true)inProviderConfigInfoSchema— backward-compatible default for version skew resilience.Validation
make static-checkpasses (ESLint, typecheck, prettier, mintlify links)Risks
Low. The
isEnabledfield defaults totruewhen missing, so existing configs are unaffected. The gateway bypass is explicitly tested. The main risk is cosmetic — the yellow status dot color may need design review for theme consistency.Generated with
mux• Model:anthropic:claude-opus-4-6• Thinking:xhigh• Cost:$9.24