Skip to content

fix: preserve multimodal tool results across client round trips - #1284

Draft
sravan-v wants to merge 6 commits into
TanStack:mainfrom
sravan-v:fix/multimodal-tool-result-roundtrip
Draft

fix: preserve multimodal tool results across client round trips#1284
sravan-v wants to merge 6 commits into
TanStack:mainfrom
sravan-v:fix/multimodal-tool-result-roundtrip

Conversation

@sravan-v

@sravan-v sravan-v commented Sep 1, 2026

Copy link
Copy Markdown

🎯 Changes

Fixes #1283.

TOOL_CALL_RESULT arrives with the tool output serialized as a string. When that string contains a valid ContentPart[], keeping it as plain text means the structured result is lost before uiMessagesToWire builds the next request.

This change restores valid content-part arrays while leaving ordinary string and JSON tool results unchanged. It also adds regression coverage for the stream-processor → wire round trip, including the e2e suite.

No docs change: this restores the existing multimodal tool-result behavior rather than adding a new API.

✅ Checklist

  • I followed the contributing guide
  • I tested locally with pnpm run test:pr
  • I fully understand the code in this pull request, including code generated with AI assistance
  • I updated docs/ for this change, or this change is not user-facing
  • I added a changeset for the published package change

🚀 Release Impact

  • This affects published code and includes a changeset
  • This is docs/CI/dev-only

Local pnpm test:pr was not run in this environment; the PR checks are expected to validate the test, typecheck, lint, and build paths.

@coderabbitai

coderabbitai Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

Multimodal tool results lose their image parts on the client round trip

1 participant