Skip to content

🤖 feat: preview markdown attach_file outputs#3318

Merged
ThomasK33 merged 1 commit into
mainfrom
feat/attach-file-markdown-preview
May 19, 2026
Merged

🤖 feat: preview markdown attach_file outputs#3318
ThomasK33 merged 1 commit into
mainfrom
feat/attach-file-markdown-preview

Conversation

@ThomasK33
Copy link
Copy Markdown
Member

Summary

Adds display-only markdown support to attach_file, so generated .md files can be previewed and downloaded in chat without being sent back to the model as file attachments.

Background

Agents can already use file read tools when they need markdown contents. This keeps that boundary intact while making agent-generated markdown files easy for users to inspect and save.

Implementation

  • Treat .md, .markdown, .mdown, and explicit text/markdown overrides as display-only attach_file outputs.
  • Render display-only markdown with the existing sanitized markdown renderer and keep the existing download affordance.
  • Document the attach_file tool behavior as model-attachment support for images/PDFs plus display-only markdown.

Validation

  • bun test src/node/services/tools/attach_file.test.ts src/browser/features/Tools/AttachFileToolCall.test.tsx
  • make static-check
  • Dogfooded via Storybook with agent-browser: opened app-chat-tools-attachfile--display-only-markdown, verified the markdown preview and Download link, and captured screenshot/video evidence in chat.

Risks

Low. The new path reuses the existing display-only file mechanism, so markdown bytes are stripped from provider requests like other display-only files. Non-markdown text-like files still fail and direct the agent toward file_read.


Generated with mux • Model: openai:gpt-5.5 • Thinking: xhigh • Cost: $10.87

Show markdown files attached through attach_file as display-only previews with download affordances, keeping their bytes out of model attachments.

---

_Generated with `mux` • Model: `openai:gpt-5.5` • Thinking: `xhigh` • Cost: `$10.87`_

<!-- mux-attribution: model=openai:gpt-5.5 thinking=xhigh costs=10.87 -->
@ThomasK33
Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ThomasK33 ThomasK33 added this pull request to the merge queue May 19, 2026
Merged via the queue into main with commit 6228c61 May 19, 2026
24 checks passed
@ThomasK33 ThomasK33 deleted the feat/attach-file-markdown-preview branch May 19, 2026 06:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant