What issue are you seeing?
Codex can generate model-visible MCP tool names longer than the 64-character maximum accepted by Amazon Bedrock Runtime.
PR #39594 raised MAX_TOOL_NAME_LENGTH from 64 to 128 bytes to match the OpenAI Responses API. When Codex uses an OpenAI-compatible gateway that forwards requests to Bedrock, MCP tool names between 65 and 128 characters now pass Codex normalization but are rejected downstream by Bedrock.
This is especially easy to encounter with Codex Apps because the mcp__codex_apps__ namespace consumes 17 characters before the individual tool name is appended.
AWS documents a maximum tool-name length of 64 characters:
https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ToolSpecification.html
What steps can reproduce the bug?
- Configure Codex to use an OpenAI-compatible model gateway backed by Amazon Bedrock Runtime.
- Enable Codex Apps or another MCP server exposing a tool whose fully qualified model-visible name is longer than 64 characters.
- Start a request that includes the MCP tool definitions.
- Observe that Codex accepts and forwards the tool name, but the Bedrock-backed request is rejected because the tool name exceeds 64 characters.
This behavior is present in Codex CLI 0.153.2. Version 0.148.0 still normalized names to at most 64 bytes; version 0.149.0 contains the change to 128 bytes.
What is the expected behavior?
Codex should keep model-visible tool names within the limit supported by the selected provider. A provider-specific or configurable maximum tool-name length would allow OpenAI Responses API providers to use 128 bytes while Bedrock-backed providers continue using 64.
Shortened names should retain deterministic hashing and collision handling so that calls can be mapped back to the original MCP server and tool.
Additional information
The original 64-character MCP name handling was introduced for #1289 by #1571. PR #39594 later raised the limit from 64 to 128 bytes specifically for the Responses API.
Current workaround: place a proxy between Codex and the gateway that deterministically shortens tool names to 64 characters and reverses the mapping for returned tool calls.
References:
What issue are you seeing?
Codex can generate model-visible MCP tool names longer than the 64-character maximum accepted by Amazon Bedrock Runtime.
PR #39594 raised
MAX_TOOL_NAME_LENGTHfrom 64 to 128 bytes to match the OpenAI Responses API. When Codex uses an OpenAI-compatible gateway that forwards requests to Bedrock, MCP tool names between 65 and 128 characters now pass Codex normalization but are rejected downstream by Bedrock.This is especially easy to encounter with Codex Apps because the
mcp__codex_apps__namespace consumes 17 characters before the individual tool name is appended.AWS documents a maximum tool-name length of 64 characters:
https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ToolSpecification.html
What steps can reproduce the bug?
This behavior is present in Codex CLI 0.153.2. Version 0.148.0 still normalized names to at most 64 bytes; version 0.149.0 contains the change to 128 bytes.
What is the expected behavior?
Codex should keep model-visible tool names within the limit supported by the selected provider. A provider-specific or configurable maximum tool-name length would allow OpenAI Responses API providers to use 128 bytes while Bedrock-backed providers continue using 64.
Shortened names should retain deterministic hashing and collision handling so that calls can be mapped back to the original MCP server and tool.
Additional information
The original 64-character MCP name handling was introduced for #1289 by #1571. PR #39594 later raised the limit from 64 to 128 bytes specifically for the Responses API.
Current workaround: place a proxy between Codex and the gateway that deterministically shortens tool names to 64 characters and reverses the mapping for returned tool calls.
References: