Skip to content

Media embeds don't render when the file path contains a space (agents aren't told to wrap paths in <…>) #26685

Open

Description

@kalibismail

What happened

On Windows, when the user's home folder name contains a space, agents embed screenshots and videos using a path that is not wrapped, so the chat shows the raw text instead of the media:

![Practice walkthrough](C:\Users\First Last\AppData\Local\Temp\08ebdcea\walkthrough.mp4)

This happens every time an agent sends media from a file under the home folder.

Diagnosis

In CommonMark, a link destination ends at the first space unless it is wrapped in <…>. Because of this, the line above never becomes an image node, so ChatMarkdown's img handler never runs.

The renderer already handles the wrapped form: ChatMarkdown.browser.test.tsx renders ![Shot](</work/my shot.png>). The gap is in the instruction given to agents in packages/provider-core/src/server/runtimeInstructions.ts:

You can embed images, video, and audio in your response using Markdown image syntax with absolute file paths.

The instruction says nothing about paths that contain spaces, so agents write bare paths. Every Windows user whose username contains a space hits this, as does anyone whose files live under a folder name with a space.

Possible fixes, in order of effort:

  1. Add to the runtime instruction: "wrap the path in <…> (e.g. ![alt](<C:\path with spaces\shot.png>))".
  2. Before parsing, make the chat recover ![alt](<absolute path with spaces>) when the destination is an unwrapped absolute path that exists.

Steps to reproduce

  1. On Windows, use an account whose user folder contains a space (e.g. C:\Users\First Last).
  2. In any Claude thread, ask the agent to take a screenshot or record a video and show it in chat.
  3. The agent writes ![…](C:\Users\First Last\…\file.png), and the message shows that literal text with no media.
  4. Ask the agent to resend it as ![…](<C:\Users\First Last\…\file.png>), and the media renders.

Version

0.1.4-nightly.20261028.3841 (desktop app and local server; commit 9e09926)

Environment

Windows 10 Pro 10.0.19045, x64, Node v24.22.0. Claude Code harness, Opus 5.5.

Evidence

Screenshot of the unrendered message (attached below). The message text is the literal ![Practice walkthrough](C:\Users\<user with space>\AppData\Local\Temp\…\walkthrough.mp4) followed by a File: [walkthrough.mp4](…) link that also failed to render.

Related issues

None found. Searched for "spaces path image markdown" and "windows path space media not rendering".

Fix applied or workaround

Ask the agent to wrap media paths in <…>.

Filed by

Claude Code (Opus 5.5, claude-opus-5-5) via the T3 Code triage playbook.

Activity

  1. kirbysama commented on Nov 3, 2026

    @kirbysama

    Same bug on 0.1.6 (Windows desktop app with local server, Windows 10 Education 10.0.19045 x64, Claude Code with Opus 5.5). It has happened on every version since 0.0.45.

    One more symptom worth adding: once the line falls back to text, CommonMark drops the backslash before any punctuation in the path. The user sees
    ![Round 6: default view](C:\Users\<user with space>.t3\design-review\r6-1-default-viewport.png)
    with \.t3 collapsed to .t3. That makes it look as if the agent wrote a bad path. remarkKeepWindowsPaths (packages/shared/src/markdownWindowsPaths.ts) doesn't help here. Its prose regex UNFINISHED_DRIVE_PATH (/(?:^|\W)[A-Za-z]:(?:[\/]\S*)?$/) stops at the first space, so the escape in \.t3 is decoded anyway. The current tests only use space-free paths like C:\Users\me\.t3.

    Wrapping the path in <…> renders correctly. #27970 looks like it would fix both symptoms, and a test with a space plus a \.-prefixed folder would be useful there.

    Added by Claude Code (Opus 5.5, claude-opus-5-5) via the T3 Code triage playbook.

  2. doolecg commented on Nov 11, 2026

    @doolecg

    Still happens on 0.1.9-nightly.20261110.4465 (Windows 11 Pro, desktop app, Claude provider). The release notes for 0.1.9-nightly.20261111.4515 don't mention a fix, and I haven't tested that build.

    It is not limited to the user home folder. A project folder with a space is enough.

    Steps:

    1. Keep a project in a folder with a space, e.g. E:\REPOS\My Game.
    2. Ask the agent to take screenshots into a subfolder and show one in chat.
    3. The agent replies with ![Golden hour](E:\REPOS\My Game\shots\03_golden_hour.png).
    4. The chat shows that literal text, including the leading !, and no image.

    A path without a space renders fine. Rewriting the destination as <E:/My Game/shots/a.png> should render, as in the issue description; I haven't tested that in the app.

    I also have a small renderer-side patch for the second suggested fix (wrap spaced media destinations in <...> before parsing, skipping code spans and fences). It is untested so far, so I won't open a PR unless you want one.

  3. andresaclan commented on Nov 12, 2026

    @andresaclan

    Same bug on 0.1.8 (Windows desktop app with a local server running in WSL2, Claude Code with Opus 5.5). This bug is not limited to Windows paths: a Linux path through /mnt/c with a space in one folder name breaks the same way.

    The agent's reply contained:

    ![Game client right now](/mnt/c/Users/<user>/Documents/<folder with space>/<project>/Screenshots/client_now.png)
    

    The chat showed that line as literal text, including the !, and no image. The file exists at that path. When I resent the same paths wrapped as ![…](</mnt/c/…/<folder with space>/…/client_now.png>), both images rendered, so the renderer handles the wrapped form fine on WSL.

    A plain file link in the same message, [editor_window.png](/mnt/c/.../<folder with space>/.../editor_window.png), also showed as plain text with nothing to click. #17742 (closed) fixed file links with spaces in the path, but that fix didn't cover this one: an absolute /mnt/c/... path on 0.1.8.

    I checked the source: the instruction in packages/provider-core/src/server/runtimeInstructions.ts still says only "using Markdown image syntax with absolute file paths", both at v0.1.8 and on main today. So agents keep writing unwrapped paths, and this isn't fixed in the 0.1.10 previews.

    Workaround: add a line to the project's CLAUDE.md / AGENTS.md telling the agent to wrap media paths in <…>.


    Triaged with Claude Code (Opus 5.5) via T3 Code triage.

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