Skip to content

fix: preserve images in tool results - #4661

Merged
dgageot merged 1 commit into
docker:mainfrom
topabomb:codex/tool-result-images
Oct 20, 2026
Merged

dgageot merged 1 commit into
docker:mainfrom
topabomb:codex/tool-result-images

Conversation

@topabomb

Copy link
Copy Markdown
Contributor

Fixes #4629. Follow-up to #4608, #4609 and #4610.

#4610 keeps parallel tool replies together, but turns images into text. This restores typed image attachments after all tool replies, with their originating call IDs. It also handles the explicit-cache path and preserves following user text when messages are merged.

Responses now keeps images and files inside their function_call_output instead of adding separate user messages.

Checked with task build, task test and task lint on Linux, plus built-CLI loopback tests for Chat Completions and Responses. Regression tests also cover the existing Anthropic and Gemini 3 converters and text-only model filtering.

Gemini integration fixtures were left disabled per the contributing guide. No live-provider vision test was run for this candidate.

Keep typed Chat Completions attachments after the complete tool-result group, including the explicit-cache path. Use native multimodal function outputs for Responses.

Signed-off-by: Topabomb <hualei.hb@gmail.com>
@topabomb
topabomb requested a review from a team as a code owner October 20, 2026 03:05
@aheritier aheritier added area/providers/openai For features/issues/fixes related to the usage of OpenAI models area/runtime Runtime engine, agent loop execution, tool dispatch, loop detection kind/fix PR fixes a bug (maps to fix:). Use on PRs only. labels Oct 20, 2026
@dgageot
dgageot added this pull request to the merge queue Oct 20, 2026
Merged via the queue into docker:main with commit 745f7e4 Oct 20, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/providers/openai For features/issues/fixes related to the usage of OpenAI models area/runtime Runtime engine, agent loop execution, tool dispatch, loop detection kind/fix PR fixes a bug (maps to fix:). Use on PRs only.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OpenAI Chat Completions: tool-result images are sent as plain text after #4610

3 participants