Skip to content

[codex] reject empty base64 image inputs#24169

Draft
rhan-oai wants to merge 1 commit into
mainfrom
codex/reject-empty-base64-images
Draft

[codex] reject empty base64 image inputs#24169
rhan-oai wants to merge 1 commit into
mainfrom
codex/reject-empty-base64-images

Conversation

@rhan-oai
Copy link
Copy Markdown
Collaborator

Summary

  • Map Responses API .image_url invalid_value 400s into InvalidImageRequest so existing invalid-image recovery can run for empty/invalid base64 image URL failures.
  • Replace empty data:image/*;base64, user images with model-visible text instead of emitting an input_image item.
  • Replace empty base64 image outputs from MCP and dynamic tool paths with text feedback before they are serialized as tool output images.

Why

Empty base64 image URLs are a known low-level poisoned-thread shape. They are always invalid for the Responses API, and letting them through causes later turns or resumes to replay the same bad image_url and fail before the model can recover.

This keeps the scope intentionally narrow: it does not add a broad image validator, durable history patching, or all-image replacement semantics.

Validation

  • just fmt
  • cargo test -p codex-api
  • cargo test -p codex-protocol
  • git diff --check

Not run: full workspace test suite.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant