Client or integration
Claude Code
Provider or upstream service
OpenAI Responses API / ChatGPT Codex
OpenCodex version
2.47.0 / commit 8bc9e4e
Endpoint or capability
/v1/messages → /v1/responses function tool translation
Current behaviour
When Claude Code sends a custom tool definition without an explicit strict field, OpenCodex translates it into a Responses function tool while also omitting strict.
This changes the request semantics because the Responses API treats an omitted strict value as strict mode. As a result, parameters that are optional in the original Anthropic input_schema can be treated as required by the upstream Responses provider.
For example, a tool may require only prompt while defining isolation and options as optional. After translation, the upstream provider applies strict schema handling even though the client did not request it.
Expected behaviour
Translated function tools should preserve the semantics of the original Anthropic tool definition:
- If
strict is omitted, OpenCodex should emit strict: false.
- An explicit
strict: false should remain false.
- An explicit
strict: true should remain true.
- The supplied JSON Schema should be forwarded without rewriting its
properties, required, or nested schemas.
- Hosted tools such as web search should remain unaffected.
- Native Anthropic passthrough should remain unaffected.
Minimal redacted request or reproduction
curl http://127.0.0.1:10100/v1/messages \
-H 'content-type: application/json' \
-H 'x-api-key: REDACTED' \
-H 'anthropic-version: 2023-06-01' \
-d '{
"model": "openai/gpt-5.4",
"max_tokens": 32,
"messages": [
{
"role": "user",
"content": "Run a local agent."
}
],
"tool_choice": {
"type": "tool",
"name": "Agent"
},
"tools": [
{
"name": "Agent",
"description": "Run an agent",
"input_schema": {
"type": "object",
"properties": {
"prompt": {
"type": "string"
},
"isolation": {
"type": "string",
"enum": ["worktree", "remote"]
},
"options": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean"
}
}
}
},
"required": ["prompt"],
"additionalProperties": false
}
}
]
}'
Actual response or error
The forwarded `/v1/responses` function tool omits the `strict` field:
{
"type": "function",
"name": "Agent",
"parameters": {
"type": "object",
"properties": {
"prompt": { "type": "string" },
"isolation": {
"type": "string",
"enum": ["worktree", "remote"]
},
"options": {
"type": "object",
"properties": {
"enabled": { "type": "boolean" }
}
}
},
"required": ["prompt"],
"additionalProperties": false
}
}
The Responses upstream consequently applies its default strict semantics, although the originating Anthropic request did not enable strict tool use. This breaks tool calls in which the optional arguments are omitted.
Upstream documentation
Anthropic tool definitions and optional parameters:
https://platform.claude.com/docs/en/agents-and-tools/tool-use/define-tools
Anthropic strict tool use is enabled explicitly with strict: true:
https://platform.claude.com/docs/en/agents-and-tools/tool-use/strict-tool-use
OpenAI Responses API reference:
https://platform.openai.com/docs/api-reference/responses/create
Suggested mapping or implementation notes
During Anthropic Messages → Responses translation, emit:
strict: typeof tool.strict === "boolean" ? tool.strict : false
The value must then survive the internal parser and the Responses adapter unchanged. Regression coverage should exercise omitted, false, and true values through the complete outbound request-building path and verify that the original JSON Schema is unchanged.
Additional context and attachments
The fix has been verified against the reported failure. It restores optional tool arguments while preserving explicit strict-mode requests, hosted web search, and native Anthropic passthrough.
Checks
Client or integration
Claude Code
Provider or upstream service
OpenAI Responses API / ChatGPT Codex
OpenCodex version
2.47.0 / commit 8bc9e4e
Endpoint or capability
/v1/messages → /v1/responses function tool translation
Current behaviour
When Claude Code sends a custom tool definition without an explicit
strictfield, OpenCodex translates it into a Responses function tool while also omittingstrict.This changes the request semantics because the Responses API treats an omitted
strictvalue as strict mode. As a result, parameters that are optional in the original Anthropicinput_schemacan be treated as required by the upstream Responses provider.For example, a tool may require only
promptwhile definingisolationandoptionsas optional. After translation, the upstream provider applies strict schema handling even though the client did not request it.Expected behaviour
Translated function tools should preserve the semantics of the original Anthropic tool definition:
strictis omitted, OpenCodex should emitstrict: false.strict: falseshould remain false.strict: trueshould remain true.properties,required, or nested schemas.Minimal redacted request or reproduction
Actual response or error
Upstream documentation
Anthropic tool definitions and optional parameters:
https://platform.claude.com/docs/en/agents-and-tools/tool-use/define-tools
Anthropic strict tool use is enabled explicitly with
strict: true:https://platform.claude.com/docs/en/agents-and-tools/tool-use/strict-tool-use
OpenAI Responses API reference:
https://platform.openai.com/docs/api-reference/responses/create
Suggested mapping or implementation notes
During Anthropic Messages → Responses translation, emit:
strict: typeof tool.strict === "boolean" ? tool.strict : false
The value must then survive the internal parser and the Responses adapter unchanged. Regression coverage should exercise omitted, false, and true values through the complete outbound request-building path and verify that the original JSON Schema is unchanged.
Additional context and attachments
The fix has been verified against the reported failure. It restores optional tool arguments while preserving explicit strict-mode requests, hosted web search, and native Anthropic passthrough.
Checks