Uh oh!
There was an error while loading. Please reload this page.
🤖 feat: custom providers can choose their LLM API format - #3938
Conversation
…-responses, anthropic-messages)
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
ibetitsmike
commented
Aug 23, 2026
@codex review |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:df0bff3523
ℹ️ 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".
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
…ormat edits, UI resync on failed persistence)
ibetitsmike
commented
Aug 23, 2026
@codex review |
This comment has been minimized.
This comment has been minimized.
ibetitsmike
commented
Aug 23, 2026
@codex review |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:639004a620
ℹ️ 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".
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
…adapters, tools identity wire remap, in-lock shadow recheck, drop manual useMemo)
ibetitsmike
commented
Aug 23, 2026
@codex review |
There was a problem hiding this comment.
💡 Codex Security Review
Here are some automated security review suggestions for this pull request.
Reviewed commit:5782e2cd4a
Only the user who started this review can view the report in Codex.
ℹ️ About Codex security reviews in GitHub
This is an experimental Codex feature. Security reviews are triggered when:
- You comment "@codex security review"
- A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review
Once complete, Codex will leave suggestions, or a comment if no findings are found.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:5782e2cd4a
ℹ️ 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".
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
…apters, store policy, raw-identity metadata, cache classification, keyless auth headers, drop useCallback)
ibetitsmike
commented
Aug 23, 2026
@codex review |
This comment has been minimized.
This comment has been minimized.
ibetitsmike
commented
Aug 23, 2026
@codex review |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:05bd8b58d9
ℹ️ 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".
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
…ptions, Anthropic base URL path normalization)
ibetitsmike
commented
Aug 23, 2026
@codex review |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:895a24c462
ℹ️ 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".
Uh oh!
There was an error while loading. Please reload this page.
…advisor createModel so alias metadata survives the wire remap)
ibetitsmike
commented
Aug 23, 2026
@codex review |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:0a5ee4bd61
ℹ️ 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".
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
💡 Codex Security Review
Here are some automated security review suggestions for this pull request.
Reviewed commit:7b18a91b23
Only the user who started this review can view the report in Codex.
ℹ️ About Codex security reviews in GitHub
This is an experimental Codex feature. Security reviews are triggered when:
- You comment "@codex security review"
- A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review
Once complete, Codex will leave suggestions, or a comment if no findings are found.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:7b18a91b23
ℹ️ 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".
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:7b18a91b23
ℹ️ 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".
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
…he wire when Anthropic beta features are disabled)
ibetitsmike
commented
Aug 24, 2026
@codex review |
This comment has been minimized.
This comment has been minimized.
ibetitsmike
commented
Aug 24, 2026
@codex review |
Codex Review: Didn't find any major issues. Delightful! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
This comment has been minimized.
This comment has been minimized.
ibetitsmike
commented
Aug 24, 2026
@codex review |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:a904cc88c8
ℹ️ 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".
Uh oh!
There was an error while loading. Please reload this page.
ibetitsmike
commented
Aug 24, 2026
@codex review |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:a904cc88c8
ℹ️ 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".
Uh oh!
There was an error while loading. Please reload this page.
All three SDK adapters (@ai-sdk/anthropic, @ai-sdk/openai, @ai-sdk/openai-compatible) build request URLs by appending the endpoint path directly onto the base URL string, so a query or fragment swallows the endpoint (https://proxy.example/v1?token=x -> .../v1?token=x/messages). Reject such base URLs at addCustomProvider, setConfig baseUrl edits, and the add form instead of silently stripping them: auth query params can never work with these adapters, and stripping would surface as a confusing request-time 401.
ibetitsmike
commented
Aug 24, 2026
@codex review |
This comment has been minimized.
This comment has been minimized.
ibetitsmike
commented
Aug 24, 2026
@codex review |
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Summary
Custom providers can now choose their LLM API format. The custom-provider
providerTypefield, previously locked to"openai-compatible", accepts three values that select the SDK adapter and wire format:openai-compatible(Chat Completions via@ai-sdk/openai-compatible, still the default),openai-responses(OpenAI Responses API via@ai-sdk/openai), andanthropic-messages(Anthropic Messages via@ai-sdk/anthropic). The Settings UI gains an "API format" selector in the add form and on each custom provider card.Fixes#3934
Background
LLM gateways expose different models behind different API formats (e.g. OpenCode Zen serves some models over Chat Completions and others over Anthropic Messages). Built-in
openai/anthropicproviders already accept a custombaseUrl, but custom-named provider entries were hardcoded to the OpenAI-compatible Chat Completions path at every layer (schema, guards, ProviderService, model factory).Implementation
CUSTOM_PROVIDER_TYPESincustomProviders.tsis the single source of truth; the config schema, oRPC schemas, guards, and UI labels derive from it. TheisCustomOpenAICompatible*helper family is renamed to format-agnosticisCustomProviderConfig/getCustomProviderIds/etc. since membership/shadowing semantics are identical for all custom types.providerType: the existingcreateOpenAICompatiblepath is unchanged; the two new paths reuse the lazyPROVIDER_REGISTRYloaders and the format-appropriate base URL normalization (/v1handling differs between the OpenAI-shaped and Anthropic adapters). Custom adapters always receive an explicitapiKeyso the official SDKs cannot silently fall back toOPENAI_API_KEY/ANTHROPIC_API_KEYenv vars and leak real credentials to a third-party gateway. Theanthropic-messagespath reuses the prompt-cachecache_controlfetch wrapper.addCustomOpenAICompatibleProvideris renamed toaddCustomProviderand accepts an optionalproviderType(defaultopenai-compatible);setProviderConfigacceptsproviderTypeedits validated against the enum. Existing configs parse and behave identically; no migration./v1/chat/completions,/v1/responses,/v1/messages). A shared happy-dom SelectPrimitive double (tests/ui/selectPrimitiveDouble.tsx, extracted from the advisor settings test) makes the Radix Select interactions testable.Validation
make static-check, touched unit suites, andTEST_INTEGRATION=1 bun x jest tests/ipc/providers/openaiCompatible.test.tsall green locally.openai-compatibleentries and built-in provider cards regression-checked, and a real-model smoke chat succeeded.Risks
Low for existing setups: the
openai-compatiblepath and its base URL normalization are byte-for-byte unchanged, andproviderTypestill defaults to it everywhere. The new paths reuse the built-in providers' adapters. Main regression surface is the guard renames touching provider shadowing/routing checks; those are mechanical and covered by existing tests.Generated with
xum• Model:anthropic:claude-fable-5• Thinking:xhigh