Client or integration
Codex App
Area
Provider adapter
Summary
Anthropic 400: tool_use ids were found without tool_result blocks immediately after
When using an Anthropic (Claude) backend, requests fail with:
messages.4: tool_use ids were found without tool_result blocks immediately after: call_4d252114da304363a52244af
Root cause in messagesToAnthropicFormat (line ~424): when an assistant message's text+thinking content is filtered to empty, if (content.length === 0) break skips the entire toolResult processing block. Tool_use blocks are collected but never paired with tool_result blocks — no synthetic [missing tool_result] is created.
Reproduction
- ocx start
- Configure Anthropic backend (claude-opus-4-6-thinking) via google-antigravity
- Use Codex for a session with multiple tool calls until conversation history is large
- Observe: messages.4: tool_use ids were found without tool_result blocks
Version
2.7.42
Operating system
Windows 11 24H2
Provider and model
google-antigravity / claude-opus-4-6-thinking
Logs or error output
Provider error 400: Antigravity invalid request: {"type":"error","error":{"type":"invalid_request_error","message":"messages.4: `tool_use` ids were found without `tool_result` blocks immediately after: call_4d252114da304363a52244af. Each `tool_use` block must have a corresponding `tool_result` block in the next message."}}
Screenshots and supporting files
No response
Redacted configuration
Checks
Client or integration
Codex App
Area
Provider adapter
Summary
Anthropic 400:
tool_useids were found withouttool_resultblocks immediately afterWhen using an Anthropic (Claude) backend, requests fail with:
messages.4: tool_use ids were found without tool_result blocks immediately after: call_4d252114da304363a52244afRoot cause in messagesToAnthropicFormat (line ~424): when an assistant message's text+thinking content is filtered to empty,
if (content.length === 0) breakskips the entire toolResult processing block. Tool_use blocks are collected but never paired with tool_result blocks — no synthetic [missing tool_result] is created.Reproduction
Version
2.7.42
Operating system
Windows 11 24H2
Provider and model
google-antigravity / claude-opus-4-6-thinking
Logs or error output
Provider error 400: Antigravity invalid request: {"type":"error","error":{"type":"invalid_request_error","message":"messages.4: `tool_use` ids were found without `tool_result` blocks immediately after: call_4d252114da304363a52244af. Each `tool_use` block must have a corresponding `tool_result` block in the next message."}}Screenshots and supporting files
No response
Redacted configuration
Checks