Skip to content

Fix: use function apply_patch tool for Bedrock model#19416

Merged
celia-oai merged 1 commit intomainfrom
codex/bedrock-cmb-apply-patch-function
Apr 24, 2026
Merged

Fix: use function apply_patch tool for Bedrock model#19416
celia-oai merged 1 commit intomainfrom
codex/bedrock-cmb-apply-patch-function

Conversation

@celia-oai
Copy link
Copy Markdown
Collaborator

Why

openai.gpt-5.4-cmb is served through the Amazon Bedrock provider, whose request validator currently accepts function and mcp tool specs but rejects Responses custom tools. The CMB catalog entry reuses the bundled gpt-5.4 metadata, which marks apply_patch_tool_type as freeform. That causes Codex to include an apply_patch tool with type: "custom", so even heavily disabled sessions can fail before the model runs with:

Invalid tools: unknown variant `custom`, expected `function` or `mcp`

This is provider-specific: the model should still expose apply_patch, but for Bedrock it needs to use the JSON/function tool shape instead of the freeform/custom shape.

What Changed

  • Override the openai.gpt-5.4-cmb static catalog entry to set apply_patch_tool_type to function after inheriting the rest of the gpt-5.4 model metadata.
  • Update the catalog test expectation so the CMB entry continues to track gpt-5.4 metadata except for this Bedrock-specific tool shape override.

Verification

  • cargo test -p codex-model-provider
  • just fix -p codex-model-provider

@celia-oai celia-oai changed the title Use function apply_patch tool for Bedrock CMB Fix: use function apply_patch tool for Bedrock model Apr 24, 2026
@celia-oai celia-oai requested a review from pakrym-oai April 24, 2026 18:24
@celia-oai celia-oai enabled auto-merge (squash) April 24, 2026 18:25
@celia-oai celia-oai merged commit 0db6811 into main Apr 24, 2026
25 checks passed
@celia-oai celia-oai deleted the codex/bedrock-cmb-apply-patch-function branch April 24, 2026 18:45
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 24, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants