Open generated images from tool activity#4427
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
ApprovabilityVerdict: Needs human review This PR introduces a new feature for displaying generated images from tool activity, adding new UI components, server-side asset handling, and state management across multiple packages. New features of this scope warrant human review to validate the integration and user experience. You can customize Macroscope's approvability policy. Learn more. |
b923a8c to
3cc953f
Compare
3cc953f to
f20908f
Compare
f20908f to
c0a41f8
Compare
77a0abd to
2422be0
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 9939cc9. Configure here.
| kind: "generated-image"; | ||
| activityId: EventId; | ||
| name: string; | ||
| loadRequestId: number; |
There was a problem hiding this comment.
v8 persist skips loadRequestId
Low Severity
This change makes loadRequestId part of the persisted generated-image surface and uses it in the GeneratedImagePanel React key, but RIGHT_PANEL_STORAGE_VERSION stays at 8. Clients that already saved v8 generated-image tabs without that field will rehydrate without running migration, so loadRequestId can be missing and the panel key becomes unstable until the user opens the image again.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 9939cc9. Configure here.


What Changed
imageGenerationactivities and expose only their activity ID and filename to the client timeline.Why
Generated images already arrive with a provider-saved path in completed tool activity, but that activity was rendered only as a text work-log row. The image should remain viewable after streaming finishes and after a thread is reloaded, without depending on the assistant to repeat a filename.
The interaction follows the Codex desktop pattern: images remain compact, link-like evidence in the transcript and open on demand in the existing right-side workspace. This avoids large automatic thumbnails and avoids requesting image assets until the user selects one.
This builds on the direction explored by #3984, which promotes image filenames explicitly mentioned in assistant Markdown, and #4321, which covers broader workspace/browser media references. Neither PR is included as a dependency here.
UI Changes
Current browser evidence
Captured from the exact current PR head
9939cc9a46e6a33dbbca4961b1c755f9ed6fae21in the combined package0.0.29-patched-main-20260724(integration4dd4cef4039303179929a1dbdbf0c9b358c076f9). The fixture uses a real providerimageGenerationevent in a disposable repository.MP4 version of the interaction
Checklist
pnpm exec vp test run apps/web/src/rightPanelStore.test.ts apps/web/src/components/chat/MessagesTimeline.test.tsx apps/web/src/components/chat/GeneratedImagePanel.test.tsx apps/server/src/assets/GeneratedImageResolver.test.ts(48 tests)pnpm exec vp checkfor all changed server/web filespnpm --filter t3 run typecheckpnpm --filter @t3tools/web run typecheckcurrently reports only existing unrelated errors inBranchToolbarBranchSelector.tsx,ModelPickerContent.tsx,PreviewAutomationHosts.tsx, and the atom query hooksNote
Medium Risk
Touches signed asset issuance and filesystem path validation for provider-saved files; scope is bounded by image-preview checks and exact basename matching, with retries limited to not-found races.
Overview
Provider-generated images can be opened on demand from completed
imageGenerationtool activity instead of only showing as plain work-log text.The server adds a
generated-imageasset resource:assetsCreateUrllooks up the saved path from thread projection viafindGeneratedImagePath, retries briefly when the file is not ready yet, andAssetAccessissues exact-path signed tokens (image preview paths only) with basename-locked resolution.The client exposes only activity id and filename in work-log entries (not the provider path), renders a compact filename link in the timeline, and opens a dedicated generated-image right-panel tab (
GeneratedImagePanel+useAssetUrlState). Timeline folding and work-log grouping skip generated-image rows so links stay visible when turns or tool groups collapse.Right-panel persistence bumps to v8 with migration validation for
generated-imagesurfaces.Reviewed by Cursor Bugbot for commit 9939cc9. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add generated image viewer panel accessible from tool activity work log
GeneratedImagePanelright-panel surface that fetches and displays provider-generated images via a signed asset URL, with loading and error states.generated-imageclaim kind, strict canonical path validation, and two new error types (AssetGeneratedImageNotFoundError,AssetGeneratedImageInspectionError).assetsCreateUrlRPC polls orchestration state with retry until the generated file is available before issuing a signed URL.RIGHT_PANEL_STORAGE_VERSIONto 8; persistedgenerated-imagesurfaces are validated on migration and dropped if malformed.Macroscope summarized 9939cc9.