You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Anthropic 400: tool_use ids found without tool_result blocks (messagesToAnthropicFormat) #620
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
I searched existing issues and documentation.
I removed secrets, tokens, account details, request credentials, and personal data.
Activity
github-actions commentedon Jul 28, 2026
Automated translation bookkeeping — detected language: English.
fix(anthropic): reorder interleaved text before tool_use (#640)
fix(anthropic): carry #640 tool_use reorder onto dev2-go (#691)
fix(anthropic): reorder interleaved text before tool_use (lidge-jun#640)