Repository navigation
refactor(coderd/x/chatd/chatprovider): drop provider options only direct clients read - #30958
ibetitsmike wants to merge 4 commits into
Conversation
…ect clients read Production builds only the Anthropic, OpenAI, and OpenAI-compatible clients through the AI Gateway, and each fantasy client reads only the provider options stored under its own name. Delete the Google, OpenRouter, and Vercel option converters and the Azure, Bedrock, Google, OpenRouter, and Vercel arms of applyReasoningEffort, which no built client could read.
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Keep it up! 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". |
|
@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". |
After #30929,
chatproviderstill converted Google, OpenRouter, and Vercel model-config options into fantasy provider options, andapplyReasoningEffortstill had Azure, Bedrock, Google, OpenRouter, and Vercel arms. No client that production builds reads any of them. This PR deletes the three option converters and those five effort arms.Why it is safe
fantasyConfigForAIBridgebuilds only theanthropic,openai, oropenai-compatclient, somodel.Provider()never matched the deleted arms.ProviderOptions[<its own name>](chatd never renames the compat client), so thegoogle,openrouter, andvercelentries were never sent. Pinned Gemini thinking still reaches Google through the compatextra_bodypath.TestProviderOptionsForCall_GoogleThinkingConfigand the Google, OpenRouter, and Vercel rows ofTestApplyReasoningEffort) used those provider names, so they tested deleted code. The Gemini helpers they reached keep dedicated tests, which fail on mutants of the Gemini 3 version gate, the clamp comparison, the medium level mapping, theGoogleThinkingLevelFromChatnormalization, and the compatextra_bodyassignment.TestProviderOptionsForCall_GoogleThinkingConfigSkipsNonCompatClientsfails when the compat provider check becomes!= "", and a pre-Gemini-3mediumrow inTestGoogleCompatReasoningEffortfails when that arm returnshigh. Both mutants passed before.ClampsNoneForClaude55Modelsnow use the Anthropic transport with the sameglobal.anthropic.*IDs, which the gateway sends to that transport. Changingstrings.Containstostrings.HasPrefixinanthropicReasoningEffortfails them.rg -n 'googleProviderOptionsFromChatConfig|openRouterProviderOptionsFromChatConfig|vercelProviderOptionsFromChatConfig' .: no matches.Review focus
Chat debug runs record a lower
provider_option_countfor configs that set Google, OpenRouter, or Vercel options, because those unread entries are no longer built.Validation
go test ./coderd/x/chatd/chatprovider/... ./coderd/x/chatd/chatopenai/...: pass.go test ./coderd/x/chatd/ -count=1 -p 4 -parallel 4: pass.go test -overlay: all 11 fail the named tests, and garbage copies fail to build.make pre-commit: pass.Stack
This stack removes provider code that only direct, non-gateway clients used, so
chatproviderbuilds just the three clients the AI Gateway path needs; #30979 then derives the BYOK auth header from that same client choice.