You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
multimodal image forwarding seems to be broken (kimi k3 + claude code) #888
/Users/yeowool/Desktop/test.jpg
fetch this image from macbook air and describe it
assistant response:
It's the classic pink feather-winged pig clip art: a plump pink pig standing in profile with tiny cartoon wings on its back, plus a small pink wing icon in the bottom-left corner and the caption "Not Today" along the bottom — a "when pigs fly" joke image.
Reproduction
ocx claude
make the agent fetch image from remote sources
make the agent read and describe the image
watch the agent hallucinate out of thin air
Version
2.8.0
Operating system
macOS 15.7.4
Provider and model
kimicode/k3-256k
Logs or error output
Screenshots and supporting files
No response
Redacted configuration
Checks
I searched existing issues and documentation.
I removed secrets, tokens, account details, request credentials, and personal data.
I am also experiencing this with OpenCodex on macOS.
In my case, I tried it through commandcode.io using deepseek-v4-pro. The image contained only the blue word “green” on a white background. The first response hallucinated an unrelated conversation and even included a local file path that was not present in the image. After I asked it to try again with GPT-5.6 Luna, it correctly read “green”.
This appears to be the same multimodal image-forwarding issue described here.
Triage: confirmed still present on dev — openai-chat.ts:227 flattens tool-result parts through contentPartsToText, which replaces images with the literal [image]. PR #912 is the correct fix shape (re-send image parts in a user vision message after the tool round, matching the Google/Kiro adapters); it is in the merge queue right behind #892.
Fixed on dev by #912 (merge commit 1b620266b), authored by @devmello.
What was happening. Chat Completions tool messages accept only strings or text parts, so an image inside a tool result had nowhere to go on the wire. openai-chat flattened the whole tool result through contentPartsToText, which is where the literal [image] you saw came from — and why the model then described an image it had never received.
The route, traced end to end for your kimicode/k3 + Claude Code case:
Claude Code sends an Anthropic tool_result carrying the image.
src/claude/inbound.ts:96-113 preserves it as input_image.
src/responses/parser.ts:547-555 converts it to an internal toolResult with structured image parts.
Both the Kimi OAuth preset (src/providers/registry.ts:712-741) and the API-key preset (:1428-1444) resolve to openai-chat.
That adapter flattened it.
The fix collects image parts while the tool round is consumed and flushes them as a following user message once the round closes — the same carrier shape google.ts and kiro.ts already use for the same reason.
On the second report in this thread (deepseek-v4-pro via commandcode.io): that is a different path and this fix does not cover it. Built-in DeepSeek V4 models are listed in noVisionModels (src/providers/registry.ts:1013-1016), so they route through the vision sidecar rather than direct image forwarding. A custom registry entry without equivalent capability metadata can reach the direct path instead. If you are still seeing it there after updating, please open a separate issue with your provider config — it is worth tracking on its own rather than under this one.
Verified before merge: typecheck clean on the merged tree, 42 image/EOF tests and 37 parser/vision tests passing, and a red-green ablation confirming four image-forwarding tests fail without the fix while the image-free control still passes.
Thanks for the report, and thanks @devmello for the fix.
Activity
github-actions commentedon Aug 2, 2026
Automated translation bookkeeping — detected language: unknown.
devuterian commentedon Aug 2, 2026
I am also experiencing this with OpenCodex on macOS.
In my case, I tried it through commandcode.io using deepseek-v4-pro. The image contained only the blue word “green” on a white background. The first response hallucinated an unrelated conversation and even included a local file path that was not present in the image. After I asked it to try again with GPT-5.6 Luna, it correctly read “green”.
This appears to be the same multimodal image-forwarding issue described here.
fix(openai-chat): deliver tool-result images to vision models
fix(openai-chat): deliver tool-result images to vision models
fix(openai-chat): deliver tool-result images to vision models
lidge-jun commentedon Aug 2, 2026
Triage: confirmed still present on dev —
openai-chat.ts:227flattens tool-result parts throughcontentPartsToText, which replaces images with the literal[image]. PR #912 is the correct fix shape (re-send image parts in a user vision message after the tool round, matching the Google/Kiro adapters); it is in the merge queue right behind #892.Merge pull request #912 from DevMello/fix/tool-result-images-openai-chat
lidge-jun commentedon Aug 3, 2026
Fixed on
devby #912 (merge commit1b620266b), authored by @devmello.What was happening. Chat Completions tool messages accept only strings or text parts, so an image inside a tool result had nowhere to go on the wire.
openai-chatflattened the whole tool result throughcontentPartsToText, which is where the literal[image]you saw came from — and why the model then described an image it had never received.The route, traced end to end for your kimicode/k3 + Claude Code case:
tool_resultcarrying the image.src/claude/inbound.ts:96-113preserves it asinput_image.src/responses/parser.ts:547-555converts it to an internaltoolResultwith structured image parts.src/providers/registry.ts:712-741) and the API-key preset (:1428-1444) resolve toopenai-chat.The fix collects image parts while the tool round is consumed and flushes them as a following
usermessage once the round closes — the same carrier shapegoogle.tsandkiro.tsalready use for the same reason.On the second report in this thread (
deepseek-v4-provia commandcode.io): that is a different path and this fix does not cover it. Built-in DeepSeek V4 models are listed innoVisionModels(src/providers/registry.ts:1013-1016), so they route through the vision sidecar rather than direct image forwarding. A custom registry entry without equivalent capability metadata can reach the direct path instead. If you are still seeing it there after updating, please open a separate issue with your provider config — it is worth tracking on its own rather than under this one.Verified before merge: typecheck clean on the merged tree, 42 image/EOF tests and 37 parser/vision tests passing, and a red-green ablation confirming four image-forwarding tests fail without the fix while the image-free control still passes.
Thanks for the report, and thanks @devmello for the fix.
fix(openai-chat): deliver tool-result images to vision models
Merge pull request lidge-jun#912 from DevMello/fix/tool-result-images…