[codex] replace remote images with model-visible error text (#29417)

## What

This PR will extend the existing centralized image-preparation path to
replace HTTP(S) image inputs with a model visible error message. It
won't "ruin" and break existing rollouts, but it will deprecate support
for the pathway. App server clients should no longer use HTTP image urls
if they'd like to upgrade.

The HTTP image url pathway is currently resolved in the responsesapi. It
is slow and not reccomended.

## Behavior

- HTTP(S) image URL: replace with `input_text`
- data URL: use the existing decode and resize path
- other image URL schemes: leave unchanged

This intentionally does not change app-server ingress. That validation
remains a follow-up.

## Test plan

- `just test -p codex-core -E
'test(/image_preparation|prepares_image_failures_before_history_insertion|prepares_resumed_history_before_installing_it|responses_lite_prepares_images/)'`
— 7 passed
- `just fix -p codex-core`
- `just fmt`
This commit is contained in:
rka-oai
2026-06-22 16:41:00 -07:00
committed by GitHub
Unverified
parent f1945de3b7
commit 7153affa0f
5 changed files with 69 additions and 31 deletions
+11 -3
View File
@@ -1749,9 +1749,9 @@ async fn prepares_image_failures_before_history_insertion() {
FunctionCallOutputContentItem::InputText {
text: "image content omitted because it could not be processed".to_string(),
},
FunctionCallOutputContentItem::InputImage {
image_url: "https://example.com/image.png".to_string(),
detail: Some(ImageDetail::High),
FunctionCallOutputContentItem::InputText {
text: "image content omitted because remote image URLs are not supported"
.to_string(),
},
]),
success: Some(true),
@@ -1772,6 +1772,10 @@ async fn prepares_resumed_history_before_installing_it() {
image_url: "data:image/png;base64,%%%".to_string(),
detail: Some(ImageDetail::High),
},
ContentItem::InputImage {
image_url: "https://example.com/image.png".to_string(),
detail: Some(ImageDetail::High),
},
ContentItem::InputText {
text: "keep me".to_string(),
},
@@ -1797,6 +1801,10 @@ async fn prepares_resumed_history_before_installing_it() {
ContentItem::InputText {
text: "image content omitted because it could not be processed".to_string(),
},
ContentItem::InputText {
text: "image content omitted because remote image URLs are not supported"
.to_string(),
},
ContentItem::InputText {
text: "keep me".to_string(),
},