Skip to content
This repository was archived by the owner on Nov 3, 2026. It is now read-only.
This repository was archived by the owner on Nov 3, 2026. It is now read-only.

Preview generated HTML/SVG/Markdown artifacts from tool calls #291

Open

Description

Problem

When an agent creates a visual artifact, such as an HTML chart via a file-writing tool, the chat UI currently surfaces it as a normal tool result. The user has to infer where the file went and how to view it, and hiding tool calls can also hide the only clue that the artifact exists.

This is especially noticeable for generated charts/reports: the assistant may write an HTML file successfully, but the UI does not provide a clear preview/open affordance.

Expected behavior

For previewable artifacts created by tool calls, the UI should provide a lightweight artifact card with actions such as:

  • Preview in the existing artifact panel
  • Open in a new browser tab
  • Copy access/viewing instructions

The preview should be generic and should not depend on a specific backend filesystem implementation.

Suggested generic detection

A safe first pass is to detect tool calls whose args include:

  • content: string
  • a path-like arg such as file_path, path, filename, or name
  • previewable extension such as .html, .htm, .svg, .md, or .markdown

This works for common write_file style tools without requiring backend-specific metadata.

Activity

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