-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Fix: Render MCP image outputs regardless of ordering #9815
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
joshka-oai
merged 10 commits into
openai:main
from
Kbediako:fix/mcp-image-output-nonfirst
Jan 27, 2026
Merged
Fix: Render MCP image outputs regardless of ordering #9815
joshka-oai
merged 10 commits into
openai:main
from
Kbediako:fix/mcp-image-output-nonfirst
Jan 27, 2026
+296
−42
Conversation
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
Add an image_scenario tool to the rmcp stdio test server so the Codex TUI can be exercised against mixed/invalid image blocks (text+image, invalid base64, invalid bytes, multiple images). Also document the TUI decode path (try_new_completed_mcp_tool_call_with_image_output, decode_mcp_image) to clarify that we render the first decodable image and skip failures until a valid image is found.
Collaborator
|
Added a small set of extra MCP helpers to make it possible to manually test this in b9e3749 |
joshka-oai
approved these changes
Jan 27, 2026
Collaborator
Manual testing: MCP image tool result rendering (Codex TUI)Build the rmcp stdio test server binary:cd codex-rs Register the server as an MCP server (absolute path to the built binary):codex mcp add mcpimg -- /Users/joshka/code/codex-pr-review/codex-rs/target/debug/test_stdio_server Then in Codex TUI, ask it to call:
Expected:
|
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.
What?
CallToolResult.content(including text-before-image or malformed image before valid image).Why?
How?
contentand return the first successfully decoded image instead of only checking the first block.Before
After
Risk / Impact
Tests
just fmtcargo test -p codex-tuijust fmt,cargo test -p codex-tuiFixes #9814