fix(agents): wire bedrock provider in create form submit#2417
Merged
Conversation
PR #2402 added Bedrock to the dataplane proto and the provider dropdown, but the create-page onSubmit switch was never updated. When the user picked a Bedrock-typed LLM gateway provider, the form's `provider` field was set to 'bedrock' via LLM_PROVIDER_TYPE_TO_FORM_ID, fell through to `default // openai`, and shipped `provider:{openai:{}}` with a Bedrock model ID. The aiagent then blew up with "unsupported OpenAI model: anthropic.claude-opus-4-7". Add a bedrock branch that pulls the region off the selected LLMProvider's bedrockConfig (the dataplane proto marks AIAgent.Provider.Bedrock.region as required) and builds the right oneof variant. Gateway-only for now. Direct (non-gateway) Bedrock would need its own region field in the form.
weeco
approved these changes
Apr 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Add a
case 'bedrock':branch to the AI agent create-page submit switch so the UI actually ships a Bedrock provider config when the user picks a Bedrock-typed LLM gateway provider.Why
PR #2402 added Bedrock to the dataplane
AIAgent.Provideroneof and to the provider dropdown, but the create-pageonSubmitswitch was never updated. The form'sproviderfield gets set to'bedrock'viaLLM_PROVIDER_TYPE_TO_FORM_IDinllm-config-section.tsx, then falls through todefault // openaiinai-agent-create-page.tsx. The request on the wire isprovider:{openai:{}}with a Bedrock model ID, and the aiagent pod crashes on startup with:Implementation details
The dataplane proto marks
AIAgent.Provider.Bedrock.regionas required (pattern^[a-z]{2}(-[a-z]+-\\d+)?$), but in gateway mode the region lives on theLLMProvider.bedrockConfigresource in aigw. Pull it from there at submit time and mirror it onto the agent's Bedrock oneof variant so validation passes. Credentials stay on the gateway.Gateway-only for now. Direct (non-gateway) Bedrock would need a region form field.
References
Requires matching backend work in cloudv2: CRD type, proto-to-CRD mapper, controller env-var mapping, ai-agent ProviderConfig +
createModelbranch. Filed separately.