Skip to content

PDF attachment preview flickers during agent work #39808

Closed

Description

@bdamokos

What happened

A PDF attached to a chat message flickered repeatedly in the built-in Files viewer while the agent worked in the same thread. It looked like the document was reloading and made it difficult to read. The viewer should stay open and preserve the current page and scroll position during unrelated commands.

Diagnosis

In the shipped web bundle, a change in workspaceMutationId can make FilePreviewPanel pass a fresh asset object for the same attachment ID. AttachmentFilePreview then gets a new URL refresh callback. Its effect clears the active URL, shows the loading state, and requests another URL before mounting the PDF viewer again. Attachment prop · URL refresh effect

Steps to reproduce

Suggested reproduction based on the reported session:

  1. Attach a multi-page PDF to a chat message in T3 Code Web.
  2. Open the sent attachment from the chat in the Files panel and scroll down.
  3. While the preview remains open, have the agent run a few read-only commands as separate tool calls, for example pwd and ls.
  4. Watch the PDF as the commands complete. It should remain visible at the same reading position.

Version

Web client and connected server on 0.1.12-nightly.20261120.4994 (602e5b32f58e).

Environment

Microsoft Edge on Windows, connected to an arm64 macOS server (Darwin 27.0.0, Node 24.22.1).

Evidence

The server trace recorded eight successful assets.createUrl calls within 200 ms of completed commands during the affected turn. The spans omit asset IDs, so the timing cannot identify the PDF. The reload path was confirmed in the shipped web code. A live replay in Edge remains unverified.

Related issues

#27681 was closed with a rationale about HTML and linked workspace dependencies. The later HTML fix in #39736 explicitly left PDF previews unchanged. #23632 reported PDF page resets without identifying the attachment code path or build.

Fix applied or workaround

Use Save file in the attachment preview and read the downloaded PDF in an external viewer.

Filed by

T3 Code triage via Codex, gpt-6.2-sol.

Activity

  1. added
    via-triage
    on Nov 20, 2026
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

    via-triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions