Skip to content

fix(agents): wire bedrock provider in create form submit#2417

Merged
birdayz merged 1 commit intomasterfrom
jb/fix-agent-create-bedrock-submit
Apr 22, 2026
Merged

fix(agents): wire bedrock provider in create form submit#2417
birdayz merged 1 commit intomasterfrom
jb/fix-agent-create-bedrock-submit

Conversation

@birdayz
Copy link
Copy Markdown
Contributor

@birdayz birdayz commented Apr 22, 2026

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.Provider oneof and to the provider dropdown, but the create-page onSubmit switch was never updated. The form's provider field gets set to 'bedrock' via LLM_PROVIDER_TYPE_TO_FORM_ID in llm-config-section.tsx, then falls through to default // openai in ai-agent-create-page.tsx. The request on the wire is provider:{openai:{}} with a Bedrock model ID, and the aiagent pod crashes on startup with:

failed to create models: failed to create OpenAI model: unsupported OpenAI model: anthropic.claude-opus-4-7

Implementation details

The dataplane proto marks AIAgent.Provider.Bedrock.region as required (pattern ^[a-z]{2}(-[a-z]+-\\d+)?$), but in gateway mode the region lives on the LLMProvider.bedrockConfig resource 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 + createModel branch. Filed separately.

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.
@birdayz birdayz merged commit d65f80d into master Apr 22, 2026
18 checks passed
@birdayz birdayz deleted the jb/fix-agent-create-bedrock-submit branch April 22, 2026 18:06
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.

2 participants