Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat(web): preview generated images in right panel #6029

Closedkyzer1023(GitHub profile, opens in a new tab)wants to merge 4 commits intomain fromrefs/pull/6029/headopened View on GitHub

Problem

Completed Codex image-generation activities render their saved filenames in the transcript, but selecting one follows the normal workspace-file path. In the desktop app that hands the image to the configured editor instead of previewing it inside T3 Code.

Solution

  • Preserve the generated image path while projecting Codex image-generation activities.
  • Resolve that path server-side and issue a short-lived capability for the exact image file; sibling and traversal requests remain inaccessible.
  • Open generated images as reusable, thread-scoped right-panel tabs with loading, failure, refresh, and close behavior.
  • Document the user-visible web and desktop behavior.

Other providers are unchanged because this is based on Codex's existing imageGeneration activity payload.

Impact

Users can inspect a generated image without leaving their conversation or opening an external editor. Reopening the same image refreshes and activates its existing tab instead of creating duplicates.

Validation

  • 219 focused server and web assertions passed.
  • t3, @t3tools/web, and @t3tools/contracts typechecks passed.
  • Targeted formatting passed.
  • Review hardening preserves filesystem-significant path whitespace and rejects request-time canonical path changes such as a symlink swap.
  • Reopening a generated image uses a new cache-busting URL so updated bytes are fetched immediately.
  • Generated-image lookup reads only the selected activity's saved path instead of hydrating the full thread.
  • Manually verified by the contributor in T3 Code (Dev) on Windows: selecting a generated image opened it in the right panel and did not launch the external editor.

The full AssetAccess.test.ts file currently has two pre-existing Windows-only favicon assertions that expect / instead of the native \ separator. The generated-image cases pass independently, and this change does not modify those favicon paths.

Screenshots

Before

Before: generated image link leaves T3 Code without an in-app preview

After

After: generated image opens in the T3 Code right panel

Coordination

The contributor requested review before #2829 lands. The implementation may need adaptation when orchestration V2 merges.

Authored with GPT-5.6 in T3 Code using the Codex harness.

Note

Add generated image preview panel to the chat right panel

  • Completed image generation activities are surfaced as standalone work log entries in the timeline with a clickable link that opens the image in the right panel.
  • A new generated-image right panel surface kind tracks activityId, name, and a loadRequestId counter; each call to openGeneratedImage increments loadRequestId to cache-bust the asset URL.
  • GeneratedImagePanel fetches the image via useAssetUrlState, appends a t3LoadRequest query param, and shows loading/error states.
  • The server resolves the image file path via a new ProjectionSnapshotQuery.getGeneratedImagePath SQL query and issues a signed asset URL through assetsCreateUrl WS method using a new generated-image AssetResource variant.
  • Activity payloads with itemType: 'image_view' are now projected to expose only fileName (no savedPath) to the client.
  • Persisted right panel state is migrated to version 12; invalid generated-image surfaces are dropped on migration.
Macroscope summarized 89b8332.

Note

Medium Risk Touches signed asset issuance and filesystem path validation for provider files; mitigations include exact-file tokens, symlink rejection, and activity-scoped lookups.

Overview Adds in-app preview for completed Codex image-generation activities instead of treating them like workspace file links.

Server: New generated-image asset resource resolves the provider savedPath via a narrow projection lookup (getGeneratedImagePath), issues signed URLs with generated-image claims, and serves only the exact basename with canonical-path and symlink checks. Activity projection strips full paths from payloads (filename only).

Web: Work log rows expose a link that opens a reusable right-panel tab (GeneratedImagePanel) backed by signed asset URLs and a loadRequestId cache-bust on reopen. Timeline folding keeps generated-image links visible after tool activity collapses.

Docs: User guide for generated image preview.

Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 89b833202b256e8c71521e661ab60cdd12614f80. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).
    1. coderabbitai[bot](GitHub profile, opens in a new tab)commented

      Important

      Review skipped

      Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

      ⚙️ Run configuration

      Configuration used: Repository UI

      Review profile: CHILL

      Plan: Pro Plus

      Run ID: fbe09c53-9883-4eaa-a1b9-3f675e01037b

      You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

      Use the checkbox below for a quick retry:

      • 🔍 Trigger review

      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.
    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    3. One finding: the generated-image branch of assetsCreateUrl wraps a projection-read failure in an error whose semantics (and caller-visible message) describe filesystem inspection of the image. Everything else in the changed Effect code follows the conventions (namespace subpath imports, structured Schema.TaggedErrorClass errors with cause and derived messages, errors constructed at the failure boundary, no hidden runtimes or service-instance injection).

      Posted via Macroscope — Effect Service Conventions
    4. Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.

      Fix All in Cursor ❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the [Cursor dashboard](https://www.cursor.com/dashboard/bugbot).

      Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.

      Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 62a40aea5869b235a27fe0fcef78bf299c367bce. Configure [here](https://www.cursor.com/dashboard/bugbot).
    5. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Needs human review

      New feature introducing user-facing image preview capability with new UI components, state management, asset types, and server-client integration. New features with this scope warrant human review.

      You can customize Macroscope's approvability policy. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    6. Note

      🤖 GPT-5.6 Sol responding on behalf of Theo

      We're closing this PR as we clean up the T3 Code backlog. Thank you for taking the time to put this together.

      This sends generated images through server assets, checkpoint data, web state, and the right panel. It adds a separate image-specific model while the retained media work is still in progress, so we are not taking this branch forward.

      If you believe we closed this in error, please reopen the PR and leave a comment explaining what we missed.

Sign in to join this conversation.