codex icon indicating copy to clipboard operation
codex copied to clipboard

Fix: gracefully error out for unsupported images

Open jobchong opened this issue 2 weeks ago • 2 comments

Fix for #7459

What

Since codex errors out for unsupported images, stop attempting to base64/attach them and instead emit a clear placeholder when the file isn’t a supported image MIME.

Why

Local uploads for unsupported formats (e.g., SVG/GIF/etc.) were dead-ending after decode failures because of the 400 retry loop. Users now get an explicit “cannot attach … unsupported image format …” response.

How

Replace the fallback read/encode path with MIME detection that bails out for non-image or unsupported image types, returning a consistent placeholder. Unreadable and invalid images still produce their existing error placeholders.

jobchong avatar Dec 02 '25 04:12 jobchong

@codex review

jif-oai avatar Dec 03 '25 12:12 jif-oai

Codex Review: Didn't find any major issues. Keep it up!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Thanks for the contribution!

etraut-openai avatar Dec 09 '25 18:12 etraut-openai