Skip to content

fix: preserve image tool results for Claude - #8

Open
lantzleiweke wants to merge 1 commit into
openchamber:mainfrom
lantzleiweke:fix/tool-result-image-attachments
Open

fix: preserve image tool results for Claude#8
lantzleiweke wants to merge 1 commit into
openchamber:mainfrom
lantzleiweke:fix/tool-result-image-attachments

Conversation

@lantzleiweke

Copy link
Copy Markdown

Summary

  • preserve multimodal OpenCode tool results when resuming parked Claude SDK tool calls
  • convert base64 image attachments to MCP-native image content blocks
  • keep text and image blocks together through the bridge resolver

Root cause

collectToolResults() reduced every tool response to extractTextContent(), and the SDK MCP handler rebuilt a text-only result. OpenCode had stored the PNG attachment correctly, but the provider bridge discarded it before Claude received the tool result.

Verification

  • bun test/smoke.ts
  • bun run build
  • regression fixture confirms text plus PNG data URL converts to MCP { type: "image", data, mimeType } content

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