codex - 💡(How to fix) Fix Codex “Copy as Markdown” embeds image attachments as huge base64 data URIs, causing paste targets to freeze

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
RAW_BUFFERClick to expand / collapse

Feedback ID: 019e2a64-5cde-7610-a413-c4082d2f246a

I ran into an issue with Copy as Markdown in the Codex desktop app. When the current Codex session contains image attachments or screenshots, using the top-left chat menu → Copy as Markdown copies the images as inline data:image/png;base64,... blocks inside the Markdown output.

This makes the copied Markdown extremely large and unsafe/unusable to paste into other apps.

Environment

  • App: Codex desktop app
  • Version: 26.513.20950 (2816)
  • OS: macOS Tahoe 26.4.1
  • Device: MacBook Pro 16-inch, Apple M5 Max, 128 GB memory

Steps to reproduce

  1. Open the Codex desktop app.
  2. Open a Codex session that contains image attachments/screenshots.
  3. Click the top-left chat menu.
  4. Select Copy as Markdown.
  5. Paste the copied content into a ChatGPT text box or Microsoft Word.

Actual behavior

  • The Markdown output contains very large inline data:image/png;base64,... image strings.
  • Pasting into the ChatGPT input box becomes extremely slow or effectively unusable.
  • Pasting into Microsoft Word creates a huge document and caused Word to become not responding, requiring Force Quit.
  • This makes the Markdown copy workflow nearly unusable for issue reporting, context transfer, and documentation.

Expected behavior

Copy as Markdown should not embed image attachments as inline base64 data URIs by default. A safer behavior would be to:

  • use compact placeholders such as [Image attachment: screenshot.png];
  • use attachment references, filenames, or local file references;
  • copy text only by default;
  • or at minimum apply a size limit and replace large data URIs with placeholders.

Suggested fix

  1. Do not inline base64 images by default in Copy as Markdown.
  2. Add a max-size guard for data:image/...;base64 content.
  3. Provide separate export/copy modes, for example:
    • Copy text only
    • Copy with attachment placeholders
    • Copy with inline images
  4. Apply the same sanitization to user messages, Codex responses, and included session logs so no image path can bypass the limit.

This is not only a formatting issue. It can freeze external apps and break the workflow for reporting Codex issues or moving session context elsewhere.

<img width="2048" height="877" alt="Image" src="https://github.com/user-attachments/assets/d55d4bd4-46bd-43cf-9fa3-24a386c000c4" /> <img width="2048" height="1712" alt="Image" src="https://github.com/user-attachments/assets/3c90a482-fe7d-488c-8b92-121eff08a595" /> <img width="2048" height="487" alt="Image" src="https://github.com/user-attachments/assets/3312d349-343a-4cc2-afe9-60977d2f0d32" />

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

Copy as Markdown should not embed image attachments as inline base64 data URIs by default. A safer behavior would be to:

  • use compact placeholders such as [Image attachment: screenshot.png];
  • use attachment references, filenames, or local file references;
  • copy text only by default;
  • or at minimum apply a size limit and replace large data URIs with placeholders.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

codex - 💡(How to fix) Fix Codex “Copy as Markdown” embeds image attachments as huge base64 data URIs, causing paste targets to freeze