Restore legacy image detail values#24644
Merged
Merged
Conversation
6fd663d to
28bff79
Compare
pakrym-oai
approved these changes
May 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Older persisted rollouts can contain
input_image.detailvalues ofautoorlowfrom beforeImageDetailwas narrowed tohigh/original. Current deserialization rejects those values, which can make resume skip later compacted checkpoints and reconstruct an oversized raw suffix before the next compaction attempt.Confirmed Sentry reports fixed by this compatibility path:
Background
openai/codex#20693 added image-detail plumbing for app-server
UserInputso input images could explicitly requestdetail: original. The Slack discussion behind that PR was about ScreenSpot / bridge evals where user input images were resized, while tool output images already had MCP/code-mode ways to request image detail.In review, the intended new API surface was narrowed to
highandoriginal: default tohigh, alloworiginalwhen callers need unchanged image handling, and avoid encouraging newautoorlowusage. That policy still makes sense for newly emitted values.The missing compatibility piece is persisted history. Older rollouts can already contain
autoandlow, and resume reconstructs typed history by deserializing those rollout records. Rejecting old values at that boundary causes valid compacted checkpoints to be skipped. This PR restoresautoandlowas real variants so old records deserialize and round-trip without being rewritten ashigh, while product paths can continue to default tohighand avoid emittingautofor new behavior.What changed
ImageDetail::AutoandImageDetail::Lowas first-class protocol values.auto/lowthrough rollout deserialization, MCP image metadata, code-mode image output, and schema/type generation.originalswitches to original-resolution loading;auto/low/highcontinue through the resize-to-fit path while retaining their detail value.lowdetail handling.Testing
just write-app-server-schemajust test -p codex-protocoljust test -p codex-toolsjust test -p codex-code-modejust test -p codex-app-server-protocoljust test -p codex-core suite::rmcp_client::stdio_image_responses_preserve_original_detail_metadatajust test -p codex-core suite::code_mode::code_mode_can_use_mcp_image_result_with_image_helperI also attempted
just test -p codex-core; the local broad run did not finish green: 2559 tests run, 2467 passed, 55 flaky, 91 failed, 1 timed out. The failures were broad timeout/deadline failures across unrelated areas; targeted changed-path core tests above passed.