Repository navigation
An input_image reaches the agent; an image URL or an unreadable part is refused by name - #733
Open
eric-epsilla wants to merge 1 commit into
Open
eric-epsilla wants to merge 1 commit into
eric-epsilla wants to merge 1 commit into
Conversation
…rectory, as an input_file does; a URL or an unreadable part is refused by name
An input_image part was kept in the turn's record and nowhere else: nothing reached the working
directory, the request answered 200 with ignored_fields [], and the agent said no image was attached.
The same image sent as input_file was read. Tasks §2 lists input_image, "an image, inline or by file_id".
- Inline: a base64 data URL, as a string or {"url": ...}, named image-<sha256[:12]>.<ext> from its bytes
unless the part names a file. The record keeps the name, not the bytes.
- By file_id: resolved by _resolve_uploads, with its organization check and 404s.
- A URL is not fetched (an address the caller picked), and a non-image or non-base64 data URL, or a part
with neither, answers 400 invalid_input naming what to send.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
Author
|
@richard-epsilla could you review this when you have a moment? Problem. An Approach. What I'd like from you:
|
This branch was successfully deployed
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The problem
An
input_imagepart, the OpenAI Responses shape for an image, never reaches the agent._parse_inputkeeps it in the turn's record and nowhere else, so nothing is written to the working directory. The request still answers 200 withignored_fields: [], and the agent answers as if no image was sent. The same image sent asinput_fileworks. Tasks §2 listsinput_imageas "an image, inline or by file_id".Reproduced on
main(93994cf):The fix
_parse_inputturns aninput_imageinto a file spec, the same way it already does for aninput_file.{"url": ...}, the Chat Completions spelling. The file is namedimage-<sha256[:12]>.<ext>from its bytes, unless the part gives afilename. The same picture sent in two turns becomes one file. The record keeps the name, not the bytes.file_id. Resolved by_resolve_uploads, with its existing organization check and 404s.invalid_inputthat says what to send. This covers anhttp(s)URL, which is not fetched because the server would be reaching an address the caller picked. It also covers a data URL that is not a base64 image, and a part with neither field.One behaviour change: a client that sends an image URL now gets a 400 instead of a 200 with the image silently dropped.
Verified
test_input_image.pyagainstmain'sapp.py:The full gateway suite on this branch:
The 13 failures are all in
test_database_mcp.py, and the same 13 fail onmainon my machine, which has no database server for those tests.main's CI is green on them, so CI on this PR should be the real check.🤖 Generated with Claude Code