Skip to content

🤖 fix(openai): omit service_tier when not configured#3212

Merged
ibetitsmike merged 1 commit intomainfrom
mike/openai-omit-service-tier
May 1, 2026
Merged

🤖 fix(openai): omit service_tier when not configured#3212
ibetitsmike merged 1 commit intomainfrom
mike/openai-omit-service-tier

Conversation

@ibetitsmike
Copy link
Copy Markdown
Contributor

@ibetitsmike ibetitsmike commented Apr 30, 2026

Summary

Stop writing serviceTier: "auto" into provider options when the user hasn't configured one, and surface that "unset" state explicitly in the Settings UI and CLI. The provider field is now omitted entirely when no value is selected, letting OpenAI apply its own default routing.

Fixed: #3196

Background

Previously the OpenAI service tier silently defaulted to "auto" everywhere: in buildProviderOptions, in the CLI's --service-tier flag, and in the Settings dropdown. That meant requests always sent service_tier: auto even when the user never picked a tier, and the UI couldn't represent the actual "no preference" state at all (the dropdown showed auto whether the config was missing or explicitly set to auto).

Implementation

  • buildProviderOptions now reads muxProviderOptions?.openai?.serviceTier directly and only spreads serviceTier into the OpenAI options when it is set.
  • src/cli/run.ts drops the "auto" default from --service-tier; if the flag is omitted, the entire openai block is left out of providerOptions.
  • ProvidersSection adds a sentinel "unset" Select item labeled Not configured (omit service_tier). Picking it sends value: "" through setProviderConfig, which the backend treats as a delete, removing the serviceTier key from providers.jsonc. A short-lived openaiServiceTierSelectOverride keeps the trigger label correct between optimistic update and refresh.
  • providerModelFactory likewise no longer coerces a missing serviceTier into "auto".

Validation

  • Sandboxed dev-server walk-through (clean install -> flex -> back to unset -> explicit auto); each transition verified against providers.jsonc on disk and the dropdown trigger label.
  • make static-check (eslint, tsgo x2, prettier, code-to-docs links, shellcheck, hadolint) clean.
  • bun test src/cli/run.test.ts src/common/utils/ai/providerOptions.test.ts src/node/services/providerService.test.ts (176 pass).

Risks

Low. Behavior change is limited to OpenAI requests: when no tier was previously configured, requests will now omit service_tier instead of sending "auto". OpenAI treats both as default routing, so live traffic should be unaffected. Existing configs with an explicit value continue to send that value verbatim.


Generated with mux • Model: anthropic:claude-opus-4-7 • Thinking: xhigh • Cost: $47.05

@ibetitsmike
Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ibetitsmike ibetitsmike added this pull request to the merge queue May 1, 2026
Merged via the queue into main with commit d2e53f6 May 1, 2026
24 checks passed
@ibetitsmike ibetitsmike deleted the mike/openai-omit-service-tier branch May 1, 2026 13:40
@mux-bot mux-bot Bot mentioned this pull request May 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Please add option to turn off OpenAI Service Tier!

1 participant