Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(chat): render assistant-generated images inline #6558

ClosedaGamingGod1234(GitHub profile, opens in a new tab)wants to merge 3 commits intomain fromrefs/pull/6558/headopened View on GitHub

Assistant-generated images are not currently preserved and rendered as first-class chat output across the T3 Code surfaces, so generated artifacts can disappear into tool activity or fail to survive settled turn folding.

This persists approved provider image output through the attachment store, carries it through provider ingestion and orchestration, and renders it inline in assistant messages on web and mobile. Image messages remain visible after settled-turn folding, and the desktop package includes a focused end-to-end fixture for the attachment flow.

Related: #6441, #6029

Validation:

  • 124 focused tests passed across server, web, and mobile
  • scoped server, web, mobile, and contracts typechecks passed
  • all 16 changed files passed formatting and changed-source lint checks

Implemented with GPT-5.6 Sol in T3 Code through the Codex harness.

Note

Render assistant-generated images inline in chat with safe URL validation

  • Adds a new ingestion path in ProviderRuntimeIngestion that extracts images from Codex generated_image and Claude tool_result provider payloads, persists them to the attachment store, and emits a completed assistant message with image attachments.
  • Adds AssistantMessageImages and AssistantMessageImageCard components that render image attachments inline with loading/error states, a download button, and an expand-to-gallery action.
  • Constrains renderable URLs via isSafeAssistantImagePreviewUrl, allowing only data URLs, blob URLs, and /api/assets/ paths (remote only when explicitly trusted).
  • Keeps image-bearing assistant messages visible in collapsed turn folds on both web (deriveTurnFolds) and mobile (deriveThreadFeedTurnFolds), even when a later terminal message exists.
  • Adds an end-to-end Playwright/Electron test in assistant-image-e2e.mjs that seeds a SQLite projection and validates the image renders via the asset endpoint.
Macroscope summarized 2cd94e1.
    1. Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

    2. 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: 550da2fb-fc92-4d11-a128-4dc4e708a51a

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

    4. Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

      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 5d646d706a7630fea733b7bcf27600c2d301dc53. Configure [here](https://www.cursor.com/dashboard/bugbot).
    5. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Needs human review

      This PR introduces a new feature for inline rendering of assistant-generated images, adding new UI components, server-side image extraction/persistence logic, and changes across multiple apps. New features with this scope of new capability warrant human review.

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

      Here are some automated review suggestions for this pull request.

      Reviewed commit: 5d646d706a

      ℹ️ About Codex in GitHub

      Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

      • Open a pull request for review
      • Mark a draft as ready
      • Comment "@codex review".

      If Codex has suggestions, it will comment; otherwise it will react with 👍.

      Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

    7. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      🟡 Medium

      https://github.com/pingdotgg/t3code/blob/de5f9fa369a0594723d211b9a72923c26554e004/apps/web/src/components/ChatView.tsx#L2527

      A failed server asset resolution marks the attachment with previewError: true, so the image renderer shows “Image unavailable” even when attachmentPreviewHandoffByMessageId provides a valid optimistic blob URL. The handoff mapping replaces only previewUrl, leaving the error flag active; clear previewError when applying the handoff URL.

      No longer relevant as of 2cd94e13ab82ea8199433db6d29b063b7581e0a5

    8. aGamingGod1234(GitHub profile, opens in a new tab)commented

      Fixed in 2cd94e13a. Applying an optimistic preview handoff explicitly clears previewError, including when the URL is unchanged.

    9. Sorry, I'm unable to act on this request because you do not have permissions within this repository.

    10. Note

      🤖 GPT-5.6 Sol responding on behalf of Theo

      Closing this PR after an automated pass over open pull requests. Workspace image rendering already shipped in #6433.

Sign in to join this conversation.