Skip to content

[Bug]: Editing a queued message breaks inline image and file attachment chips #40944

Closed

Description

@smirea

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/web

Steps to reproduce

  1. Start the web app and open a thread using Replay (dev) (showcase model) with an active turn (or send a message to start a turn so the next message queues).
  2. While the turn is running, type Check in the composer and paste a PNG image from the clipboard (an inline image.png chip appears in the editor alongside the image thumbnail).
  3. Queue the message (Ctrl/Cmd+Enter). (Optionally click Stop generation so the queued message stays queued while you inspect it.)
  4. Click Edit queued message on the queued message.
  5. Look at the inline image.png chip inside the composer editor and hover over it.

Expected behavior

The inline image.png chip in the queued-message edit composer stays resolved with its thumbnail preview and file size (matching docs/internals/composer-context-references.md, where pasted images render as resolved inline chips backed by the thumbnail inventory, and matching apps/mobile/src/state/queued-run-edit.ts, which seeds the edit draft with the full message context). Clicking the chip opens the expanded image preview, and removing the thumbnail above the editor removes the inline chip cleanly.

This is the attachment counterpart of #30850 (fixed in #30889 for thread and environment context records in useQueuedRunEdit.ts).

Actual behavior

The thumbnail still appears above the editor with a remove (×) button, but the inline chip in the rich-text editor renders as an unavailable chip (◌ image.png) with the tooltip "This context is no longer available. Remove it or attach it again.", even though the image is still attached and sent on save.

Root cause: useQueuedRunEdit keeps existing attachments in editing.existingAttachments instead of the edit draft's images/files arrays, and composerContextRecordsFromDraft only indexes live draft images/files, so existing attachment t3-context:// links have no matching record in ComposerContextRecordsContext.

Impact

Minor bug or occasional failure

Version or commit

v0.1.12-nightly.20261122.5098 (also reproduced on main @ 9de4ec1bfa0b)

Environment

Web client (reproduced on macOS desktop browser and headless Chromium via vp run scenarios --target web with Replay (dev) and no external provider account)

Logs or stack traces

No console or server errors.

Screenshots, recordings, or supporting files

Queued message edit showing inline image chip as unavailable while thumbnail is still attached

Workaround

Leave the unavailable chip untouched and save the queued message (the underlying attachment is still preserved on save), or remove the attachment and paste it again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions