amazon-bedrock provider: namespace_tools capability breaks Bedrock Mantle (validation_error)
Bug
The built-in amazon-bedrock provider sets namespace_tools: true in its capabilities (mod.rs:60). This causes Codex to serialize tools using the {"type": "namespace", ...} wrapper format. However, Bedrock Mantle's Responses API schema validator only accepts "function" and "mcp" tool types, rejecting "namespace" with:
{"error":{"code":"validation_error","message":"Failed to deserialize the JSON body into the target type: ?[13]: Invalid 'tools': unknown variant `namespace`, expected `function` or `mcp` at line 1 column 107773","param":null,"type":"invalid_request_error"}}
This is a separate issue from the URL path bug (#23650 / #21352). Even after fixing the /openai/v1 → /v1 path, users with any meaningful number of tools (MCP servers, built-in shell/apply_patch, etc.) will hit this error because namespace_tools: true wraps all tool definitions in the unsupported format.
Reproduction
- Fix the Mantle URL path (per #23650) so requests actually reach the server
- Use the
amazon-bedrockprovider with default config (any registered MCP servers or built-in tools) - Run
codex exec "hello"→ HTTP 400 validation_error aboutnamespace
With a minimal config (no MCP, features like code_mode/multi_agent_v2 off), the namespace wrapping doesn't fire for the few remaining tools, so it works. But any real-world config triggers it.
Root Cause
// codex-rs/model-provider/src/amazon_bedrock/mod.rs:58-62
fn capabilities(&self) -> ProviderCapabilities {
ProviderCapabilities {
namespace_tools: true, // ← Mantle doesn't support this
image_generation: false,
web_search: false,
}
}
When namespace_tools is true, core/src/tools/spec_plan.rs:876 wraps Function tools into Namespace:
ToolSpec::Function(tool) => ToolSpec::Namespace(ResponsesApiNamespace { ... })
The "namespace" tool type is an OpenAI-proprietary extension that Bedrock Mantle has not implemented.
Suggested Fix
fn capabilities(&self) -> ProviderCapabilities {
ProviderCapabilities {
namespace_tools: false, // Mantle only accepts "function" and "mcp"
image_generation: false,
web_search: false,
}
}
Environment
- Codex CLI v0.135.0
- Bedrock Mantle all regions (us-east-1, us-west-2, etc.)
- AWS Account with
openai.gpt-oss-120bmodel access - Tested 2026-05-29
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗