feat(agent): show tool result images & support send img to remote cha…#1690
Conversation
📝 WalkthroughWalkthroughThis PR implements promotion of tool-call image previews into assistant image blocks for improved conversation visibility and remote delivery. It introduces stable metadata linking promoted images back to originating tool calls, refactors remote asset persistence to collect and deduplicate tool-derived image candidates, and updates test coverage for both promotion and persistence paths. ChangesPlanning and Specification
Image Promotion and Remote Persistence Implementation
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/issues/remote-tool-result-images/plan.md`:
- Line 11: The plan text incorrectly implies that `data` alone suffices for
promoting tool result previews; update the sentence in the
`prepareToolImagePreviewPresentation()` description so it requires both `data`
and `mimeType` (matching the runtime contract enforced in
imageGenerationBlocks.ts around the logic in
`prepareToolImagePreviewPresentation`, lines ~31-38), e.g. state that
successful, non-error tool results with usable `data` AND a valid `mimeType` are
promoted into assistant `image` blocks.
In `@docs/issues/remote-tool-result-images/spec.md`:
- Line 13: Update the wording that currently states "resolvable/usable" for
successful `tool_call` results with `imagePreviews` to explicitly require that
each promotable preview contains both payload `data` and a `mimeType`; change
the sentence describing creation of assistant `image` blocks adjacent to the
`tool_call` so it requires `imagePreviews` entries to include `data` and
`mimeType` (apply the same explicit requirement to the other occurrence
referencing `imagePreviews` on the same spec page).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 60865bef-cbab-4478-8e84-76f00b32bade
📒 Files selected for processing (9)
docs/issues/remote-tool-result-images/plan.mddocs/issues/remote-tool-result-images/spec.mddocs/issues/remote-tool-result-images/tasks.mdsrc/main/presenter/agentRuntimePresenter/dispatch.tssrc/main/presenter/agentRuntimePresenter/imageGenerationBlocks.tssrc/main/presenter/agentRuntimePresenter/index.tssrc/main/presenter/remoteControlPresenter/services/remoteConversationRunner.tstest/main/presenter/agentRuntimePresenter/dispatch.test.tstest/main/presenter/remoteControlPresenter/remoteConversationRunner.test.ts
…nnel
Summary by CodeRabbit
Documentation
New Features