Skip to content

fix(sub): pass tool_result images to Codex/Kimi/Grok#218

Merged
fkiene merged 1 commit into
mainfrom
feat/sub-tool-result-images
Jul 26, 2026
Merged

fix(sub): pass tool_result images to Codex/Kimi/Grok#218
fkiene merged 1 commit into
mainfrom
feat/sub-tool-result-images

Conversation

@fkiene

@fkiene fkiene commented Jul 26, 2026

Copy link
Copy Markdown
Owner

Summary

User-message images were translated on the sub path, but images inside Anthropic tool_result content were dropped ([image omitted] on Codex/Grok; text-only flatten on Kimi). Screenshot-heavy tool results went blind under subscription reroute.

Changes

  • Codex / Grok (Responses): base64 tool images → function_call_output.output as content parts (input_text + input_image); pure text stays a string
  • Kimi (chat): base64 tool images → tool content parts (text + image_url); pure text stays a string
  • URL-sourced tool images stay textual placeholders on Codex/Grok; is_error prefix preserved; Codex read_rewrite notes still append

Test plan

  • cargo test -p llmtrim --lib reroute (local)
  • CI green
  • Optional live: tool that returns a base64 image under /sub on codex and confirm the model can describe it

Notes

Reactive fix only. Grok user-message images remain placeholders (out of scope). Wire shapes follow claude-code-proxy.

@fkiene
fkiene enabled auto-merge July 26, 2026 09:19
@fkiene
fkiene force-pushed the feat/sub-tool-result-images branch from e6d32d2 to 7a6a405 Compare July 26, 2026 09:19
@codecov

codecov Bot commented Jul 26, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.61261% with 55 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
crates/llmtrim-cli/src/reroute/codex.rs 88.29% 22 Missing ⚠️
crates/llmtrim-cli/src/reroute/kimi.rs 84.40% 17 Missing ⚠️
crates/llmtrim-cli/src/reroute/grok.rs 89.11% 16 Missing ⚠️

📢 Thoughts on this report? Let us know!

Base64 images inside Anthropic tool_result content were dropped on the
sub backends. Emit Responses input_image parts (Codex/Grok) or chat
image_url parts (Kimi); keep pure-text tool results as strings.

Signed-off-by: François Kiene <46886660+fkiene@users.noreply.github.com>
@fkiene
fkiene force-pushed the feat/sub-tool-result-images branch from 7a6a405 to 3b22ae3 Compare July 26, 2026 09:30
@fkiene
fkiene merged commit e3056cf into main Jul 26, 2026
30 checks passed
@fkiene
fkiene deleted the feat/sub-tool-result-images branch July 26, 2026 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant