Endless loop: The image date you provided does not represent a valid image

Resolved 💬 8 comments Opened Sep 3, 2025 by petergpt Closed Oct 29, 2025
💡 Likely answer: A maintainer (etraut-openai, contributor) responded on this thread — see the highlighted reply below.

What version of Codex is running?

0.27.0

Which model were you using?

gpt-5

What platform is your computer?

darwin 24.6.0 arm64 arm

What steps can reproduce the bug?

I am working with a bit of csv data, python to analyse and a react visualisation of this data, at some point codex says:

I’ll render an SVG preview so you can see it here, and share how to open the HTML locally.

_

✓ ⌨️ python3 trend_viz/scripts/render_svg.py

then it goes into an endless loop of

⚠  stream error: unexpected status 400 Bad Request: {
"error": {
"message": "The image data you provided does not represent a valid image. Please check your input and try again with one of the supported image formats: ['image/jpeg', 'image/png', 'image/gif',
'image/webp'].",
"type": "invalid_request_error",
"param": "input",
"code": "invalid_value"
}
}; retrying 1/5 in 204ms…

it does not matter what I say after that, it always repeats with the same error, even if no image is involved in the following message

<img width="1422" height="824" alt="Image" src="https://github.com/user-attachments/assets/e042c7be-e95e-4248-922d-9dc20165a8d6" />

What is the expected behavior?

_No response_

What do you see instead?

_No response_

Additional information

_No response_

View original on GitHub ↗

8 Comments

Kivu011 · 10 months ago

Same problem here. I also uploaded SVG and broke it... And now it just runs into endless loop.... I can't stop it no matter what I try...

alexzanco · 9 months ago

Same problem. No matter what prompt keeps throwing error

AndriiUkraine · 9 months ago

same problem :
stream error: unexpected status 400 Bad Request: {
"error": {
"message": "The image data you provided does not represent a valid image. Please check your input and try again with one of the supported image formats: ['image/jpeg', 'image/png', 'image/gif', 'image/webp'].",
"type": "invalid_request_error",
"param": "input",
"code": "invalid_value"
}
}; retrying 3/5 in 750ms…

kevinchwong · 9 months ago

Dont see this issue, when working the codebase with claude code.

nguyenbs · 9 months ago

Same problem here. An endless loop of errors

Dalanir · 9 months ago

Same here!

etraut-openai contributor · 8 months ago

Thanks for reporting the problem. This appears to be the same issue as https://github.com/openai/codex/issues/3050. I'm going to close this one to reduce duplication.

Than-yel · 8 months ago

unexpected status 400 Bad Request: {
"error": {
"message": "The image data you provided does not represent a valid image..."
"param": "input",
"code": "invalid_value"
}
}

Exactly the same problem i have with codex