Skip to content

Files tab: 'Failed to load text content' for markdown files — content-disposition: attachment prevents inline rendering #784

Closed

Description

@vybe

Summary

The Files tab shows "Failed to load text content" when trying to open any text/markdown file in an agent's workspace. The file is never displayed.

Reproduction

  1. Navigate to any agent's Files tab
  2. Click to preview a markdown file (e.g. CLAUDE.md, README.md)
  3. The preview panel shows: "Failed to load text content"

Root Cause

The /api/agents/{name}/files/preview endpoint returns a Content-Disposition: attachment header:

Content-Type: text/markdown; charset=utf-8
Content-Disposition: attachment; filename="CLAUDE.md"

The attachment disposition instructs the client to treat the response as a file download rather than displayable content. The frontend receives an HTTP 200 with a body, but the disposition causes it to fail to render the content inline — hence "Failed to load text content".

Fix

Change the Content-Disposition header on the file preview endpoint from:

Content-Disposition: attachment; filename="..."

to:

Content-Disposition: inline; filename="..."

This applies to all text-based file types served by the preview endpoint (.md, .txt, .yaml, .py, .ts, etc.).

Observed on

  • Instance: eu2 (Trinity v3a3e9a72)
  • File types confirmed affected: .md (markdown)
  • Likely affects all text file types given the header is set at the endpoint level

Expected Behaviour

Clicking a text file in the Files tab displays its content inline in the preview panel.

Activity

  1. added
    bug
    on May 11, 2026
  2. vybe commented on May 11, 2026

    @vybe
    ContributorAuthor

    /claim

  3. github-actions commented on May 11, 2026

    @github-actions

    Claimed by @vybe. Label status-in-progress added.

    Next steps:

    1. Create branch: feature/784-<short-slug>
    2. Implement the feature
    3. Open a PR with Fixes #784
  4. added
    status-in-progress
    on May 11, 2026
  5. added
    status-in-dev
    and removed
    status-in-progress
    on May 11, 2026
  6. vybe commented on Jun 1, 2026

    @vybe
    ContributorAuthor

    Shipped in v0.6.0 (released via #998).

  7. removed
    status-in-dev
    on Jun 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions