Repository navigation
Python: fix(hosting-responses): keep the media type of input_image data URLs - #9298
Merged
Eduard van Valkenburg (eavanvalkenburg) merged 1 commit intoOct 12, 2026
Conversation
Md. Shalah Uddin (shanto462)
temporarily deployed
to
github-app-auth
October 12, 2026 10:37 — with
GitHub Actions
Inactive
Md. Shalah Uddin (shanto462)
temporarily deployed
to
github-app-auth
October 12, 2026 10:37 — with
GitHub Actions
Inactive
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused implementation matches the intended behavior and includes coverage for affected and unchanged paths.
0 open findings
What changed in this PR
Fixes Responses hosting so image data URLs retain their declared media type.
Changes:
- Preserves media types such as
image/pngfor image data URLs. - Adds regression coverage for string, object, and HTTPS image URLs.
| File | Description |
|---|---|
python/packages/hosting-responses/agent_framework_hosting_responses/_parsing.py |
Retains declared data-URL image types. |
python/packages/hosting-responses/tests/hosting_responses/test_parsing.py |
Tests data and HTTPS image URL handling. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Md. Shalah Uddin (shanto462)
marked this pull request as ready for review
October 12, 2026 10:49
Md. Shalah Uddin (shanto462)
requested review from
SergeyMenshykh,
Tao Chen (TaoChenOSU),
Eduard van Valkenburg (eavanvalkenburg),
Giles Odigwe (giles17),
Jose Alvarez (jpalvarezl),
Evan Mattson (moonbox3),
Roger Barreto (rogerbarreto),
sophia-ramsey and
westey (westey-m)
as code owners
October 12, 2026 10:49
Md. Shalah Uddin (shanto462)
temporarily deployed
to
github-app-auth
October 12, 2026 10:58 — with
GitHub Actions
Inactive
Eduard van Valkenburg (eavanvalkenburg)
approved these changes
Oct 12, 2026
Eduard van Valkenburg (eavanvalkenburg)
enabled auto-merge
October 12, 2026 11:38
Md. Shalah Uddin (shanto462)
temporarily deployed
to
github-app-auth
October 12, 2026 11:39 — with
GitHub Actions
Inactive
Md. Shalah Uddin (shanto462)
deleted the
fix-responses-input-image-data-url
branch
October 19, 2026 09:42
This branch was previously 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.
Motivation & Context
messages_from_responses_inputgave everyinput_imagethe media typeimage/*, also whenimage_urlis a data URL that declares its own type. Chat clients use that media type for base64 images:AnthropicClientsentimage/*, which is not an accepted image type, andBedrockChatClientdropped the image. So images sent as data URLs to an agent behind the Responses host were rejected or lost.Description & Review Guide
data:image/...URL the parser no longer passesmedia_type="image/*", soContent.from_urikeeps the type written in the data URL. All other URLs still getimage/*. Regression tests cover the string and object forms ofimage_url, and check that an https URL still getsimage/*.image/png). Nothing changes for http(s) URLs,file_idimages, or data URLs that do not declare an image type.startswith("data:image/"), notstartswith("data:")as in the chatkit converter. Withdata:, a data URL without a type (data:;base64,...) would get the RFC 2397 defaulttext/plainand stop being treated as an image, so those keepimage/*as before.Related Issue
Fixes #9295
No other open PR covers this issue.
AI Assistance
AI assistance details: issue analysis, implementation, tests, and this PR description.
Contribution Checklist
breaking changelabel (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.