Skip to content

Chat: local Markdown images in answers still render as file links #2434

Closed

Description

@cheol-95

Problem

  • Local Markdown images in agent answers render as ! followed by a file link instead of an inline image.
  • For example, ![Diagram](./out/diagram.png) shows a clickable label, although the same image renders in the Markdown file viewer.
  • This affects answer text, independently of user attachments and tool-result image blocks.
  • The problem is reproducible in v0.4.20, and the missing Chat context is still present on main at 1a0e441f.
  • Chat: show images agents read or produce inline for pi, omp, Claude Code and Codex #992 included this as its fifth proposed change. The native transcript-image work addressed other carriers; this answer-Markdown path appears to remain incomplete.

Reproduction

  1. Use an agent pane whose working directory contains out/diagram.png.
  2. Have an answer contain ![Diagram](./out/diagram.png).
  3. Open the pane in Chat.
  4. Observe ! plus a file link instead of the picture.

Expected behavior

  • Show supported local Markdown images inline, as the Codex app does in the reported workflow.
  • Resolve relative paths against the pane's cwd, and absolute paths / local file:// URIs directly.
  • Keep unresolved or external references as links, and retain the existing image-size limit.

Diagnosis and proposed fix

  • Markdown.tsx already has MarkdownImageContext and an asynchronous image renderer.
  • FileViewer.tsx provides its resolver, but ChatView.tsx does not. With a null context the renderer deliberately uses the link fallback.
  • Supply Chat with the existing markdownImagePreview resolver through useMachineApi, including the pane ID for stat and file URLs.
  • Reuse stat-before-load, the 20 MiB inline limit, oversized-image download links, and the existing reserved image layout. No new endpoint or CSP change is needed.
  • A local patch using this approach successfully rendered two PNGs in an existing conversation. A focused PR will include regression coverage.

Environment

  • macOS, Apple Silicon
  • Ovis v0.4.20; source also checked against main at 1a0e441f
  • Codex conversation containing local Markdown image references

Pull request

Activity

  1. added a commit that references this issue on Oct 30, 2026
    4c62f57
  2. added a commit that references this issue on Oct 30, 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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions