image: add shared data URL preparation utilities - #27245
Merged
Merged
Conversation
This was referenced Jun 9, 2026
fjord-oai
force-pushed
the
fjord/responses_strict_mode_v2---4ixxjzu7eaeb3j
branch
from
June 9, 2026 21:49
d7b460e to
f649806
Compare
git-stack-id: fjord/responses_strict_mode_v2---4ixxjzu7eaeb3j git-stack-title: image: add shared data URL preparation utilities
fjord-oai
force-pushed
the
fjord/responses_strict_mode_v2---4ixxjzu7eaeb3j
branch
from
June 9, 2026 22:03
f649806 to
424af29
Compare
fjord-oai
marked this pull request as ready for review
June 10, 2026 04:13
rka-oai
reviewed
Jun 10, 2026
| /// | ||
| /// This is a high sanity guard against pathological inputs, not a protocol | ||
| /// requirement or target upload size. | ||
| pub const MAX_PROMPT_IMAGE_INPUT_BYTES: usize = 1024 * 1024 * 1024; |
Contributor
There was a problem hiding this comment.
Just flagging, responsesapi doesn't throw a direct 400 error for any size (and will just fail later during processing or context construction), but I'm aligned with this max limit, since it would almost certainly fail during processing at this size.
rka-oai
approved these changes
Jun 10, 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.
Summary
Add shared image-processing primitives needed for centralized image preparation in a follow-up PR.
load_data_url_for_promptfor decoding and preparing base64 image data URLs.Behavior
This PR is intended to be runtime behavior-preserving.
Existing production callers continue using
PromptImageMode::ResizeToFitandPromptImageMode::Originalwith their existing semantics. The new data-URL entrypoint and configurable resize mode have no production callers in this PR; they are used by the next PR in the stack.This PR does not change user-input handling,
view_image, history insertion, request construction, HTTP image URL forwarding, or app-server behavior.git stack
1image: add shared data URL preparation utilities #272452core: resize all history images behind a feature flag #272473core: strip image detail from Responses Lite requests #272464image: preserve metadata when resizing prompt images #27266