Skip to content

[Bug]: Private GitHub images in chat messages show "Image unavailable" (PR panel loads them) #25922

Open

Description

@LukeDolce

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. Open a project whose repository is a private GitHub repo, signed in with gh (the same setup where the pull request panel already shows that repo's images, after fix(web): show private repository media in pull request tabs #11706).
  2. Commit an image to the repo, e.g. docs/shot.png.
  3. Have the agent (or paste as a message) reply with Markdown that embeds it:
    ![After](https://github.com/<owner>/<private-repo>/blob/<sha>/docs/shot.png?raw=true)
    (a raw.githubusercontent.com or github.com/user-attachments/assets/<id> URL behaves the same.)
  4. Open the same pull request's tab, where that body image does render.

Expected behavior

The image renders in the chat transcript, the same way it renders in the pull request panel, since the server already holds the cwd's source control credential and already serves these URLs for the panel.

Actual behavior

The chat transcript shows "Image unavailable". The browser requests the URL without a credential and GitHub answers 404 (verified: same URL is 404 anonymously, 200 with gh auth).

Cause, on main @ 1152e91: ChatMarkdown only routes host media through the server when its sourceControlMedia prop is true (apps/web/src/components/ChatMarkdown.tsx, default false, check around line 1419). The only caller that sets it is PullRequestMarkdown.tsx (line 96). The chat transcript never passes it, so the fix from #11706 (and its move into the source control drivers in #23994) covers the pull request tab only.

Impact

Minor bug or occasional failure

Version or commit

Desktop 0.1.3 (Windows); code reading at main @ 1152e91

Environment

Windows 11 Pro, T3 Code desktop 0.1.3, Claude and Codex providers, private GitHub repo, gh authenticated with repo scope.

Workaround

Agents copy the image to a local folder and embed the local path in chat, keeping the GitHub URL only for the PR description. It works, but every agent has to remember it, and it is the usual way PR screenshots end up broken in the hand-back message.

Note

This is likely a small change (pass sourceControlMedia for assistant messages in a thread with a cwd), but it does make chat content able to trigger authenticated fetches of the repo's media, so I am filing it for triage first rather than sending a PR. Happy to send one if the direction is wanted.

Activity

  1. kalibismail commented on Oct 31, 2026

    @kalibismail

    Confirming on a newer build: T3 Code Desktop 0.1.6-nightly.20261031.3977 (macOS client) against a Linux server on the same nightly (commit 2359643). Same symptom: an assistant message embedding https://github.com/<owner>/<private-repo>/blob/<sha>/<path>.png?raw=true shows "Image unavailable". The URL returns 404 anonymously, and the file is reachable through gh api with the same machine's auth. At 2359643, sourceControlMedia is still only passed by PullRequestMarkdown.tsx, so the chat transcript still loads these images straight from the browser without credentials.

    Posted via T3 triage (Claude Opus 5.5, Claude Code agent).

  2. binjamshid commented on Nov 4, 2026

    @binjamshid
    Contributor

    Before anyone opens a PR for this, a scope question for maintainers.

    The code fix looks like 2-4 lines: pass sourceControlMedia to the chat ChatMarkdown callers (TimelineAssistantRows.tsx and TimelineUserMessageRow.tsx); both already pass threadRef, so the environment is known. But #11706 deliberately limited server-side media loading to pull request tabs. Turning it on for chat means the server would fetch any repository media URL an agent writes into a message using the user's source-control credential. I haven't checked whether guests on shared threads would then see those images too.

    Is that wanted for chat? If so, should it cover assistant messages only, or user messages too? I'm happy to send the PR with before/after screenshots once the direction is confirmed.

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