>Invalid request: an assistant message with ‘tool_calls’ must be followed by tool messages responding to each ‘tool_call_id’. The following tool_call_ids did not have response messages: view_image:36, view_image:37
Any idea how to fix this? Whenever this kind of error pops up, the conversation is dead.
This happens because when an image exceeds certain pixel dimensions (like tall full-page screenshots or retina captures), Codex locally downscales the image before sending it and injects an image_resize_notice system/developer message to inform the model of the original dimensions.
When multiple view_image tool calls are batched together, this notice gets wedged right between the tool_calls and tool outputs:
system message (image_resize_notice) ← breaks strict adjacency
tool message (view_image:36 output)
tool message (view_image:37 output)
Because our model validation strictly requires tool messages to immediately follow the assistant message, the request fails—and since the broken turn is saved in your session history, the thread stays wedged.
Workaround:
You can disable the notice injection by adding the following configuration:
[features]
image_resize_notice = false
Add this to /etc/codex/requirements.toml. While setting it in ~/.codex/config.toml works for the CLI, the Codex App may not respect user-level overrides for this flag. Putting it in /etc/codex/requirements.toml enforces it globally across both the Codex App and CLI.
(Note: Disabling this only suppresses the injected text notice. Oversized or extra-tall images will still be automatically resized locally/remotely as usual, so your requests won’t fail due to image size—though for very tall screenshots, cropping them into smaller viewport chunks is still recommended for better visual clarity.)