Windows Codex app: large pasted text fails to attach with "Large pasted text could not be attached"

Open 💬 6 comments Opened Jun 14, 2026 by FrogAi
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What happened?

When pasting large text into a Codex desktop session on Windows, the paste fails with this visible error:

Large pasted text could not be attached

This reportedly started happening in the last few days after previously working. The paste does not appear to be added to the session as text or as an attachment, so the user cannot provide large context through the composer.

Expected behavior

Large pasted text should either:

  • paste into the composer, or
  • be converted into an attached text artifact that is successfully available to the session.

Actual behavior

Codex shows the error above and the pasted content is not attached.

Reproduction steps

  1. Open Codex desktop app on Windows.
  2. Start or continue a Codex session.
  3. Copy a large text block from another application.
  4. Paste it into the Codex composer.
  5. Observe the failure toast: Large pasted text could not be attached.

Environment

  • OS: Windows 10 Pro 10.0.19045, x64, en-US
  • Codex desktop app package observed on disk: OpenAI.Codex_26.609.4994.0_x64__2p2nqsd0c76g0
  • Codex CLI: 0.139.0
  • CLI install method: npm
  • Auth mode: ChatGPT
  • Network: no proxy env vars; codex doctor reports ChatGPT reachability and websocket handshake OK

Related local diagnostics

codex doctor --json status: warning, with no failed checks. Notable warnings:

  • MCP configuration has optional issues
  • update probe returned HTTP 504 while checking latest version
  • thread inventory warning: rollout files and state DB thread inventory differ; some state DB rows point at missing or unusable rollout files

Local Codex app logs around the same period contain repeated paste-related warnings, for example:

Failed to load pasted text excerpts for title generation ... errorMessage="The system cannot find the path specified. (os error 3)"

Observed on June 11, June 12, and June 13, 2026. Raw logs were not attached here because they may contain sensitive local paths, conversation IDs, or prompt content.

Workaround

Saving the large text into a local .txt / .md file and asking Codex to read the file by absolute path appears to bypass the paste-to-attachment path.

View original on GitHub ↗

6 Comments

github-actions[bot] contributor · 1 month ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #28142

Powered by Codex Action

wbdb · 1 month ago

I can confirm this. I always have to put it into a .txt file first and then drag it in.

Version 26.609.41114 • Released 12.06.2026 / Windows 11 Pro

zzccchen · 1 month ago

I found a local workaround that fixed this on Windows.

The large-paste path appears to use a managed pasted-text attachment registry under:

$env:USERPROFILE\.codex\attachments\pasted-text-attachments.json

On the affected machine, the whole .codex\attachments directory was missing. Creating the directory and initializing the registry file fixed large text paste after restarting Codex:

New-Item -ItemType Directory -Force "$env:USERPROFILE\.codex\attachments"
'{"attachmentPaths":[],"pendingRemovalPaths":[],"textExcerptsByPath":{}}' | Set-Content -NoNewline -Encoding UTF8 "$env:USERPROFILE\.codex\attachments\pasted-text-attachments.json"

Then fully quit and reopen the Codex app.

This may point to first-run / missing-directory handling in the pasted-text attachment flow. The app logs showed fs/readFile failing with os error 3 while trying to load pasted text attachment state.

FrogAi · 1 month ago
I found a local workaround that fixed this on Windows. The large-paste path appears to use a managed pasted-text attachment registry under: $env:USERPROFILE\.codex\attachments\pasted-text-attachments.json On the affected machine, the whole .codex\attachments directory was missing. Creating the directory and initializing the registry file fixed large text paste after restarting Codex: New-Item -ItemType Directory -Force "$env:USERPROFILE\.codex\attachments" '{"attachmentPaths":[],"pendingRemovalPaths":[],"textExcerptsByPath":{}}' | Set-Content -NoNewline -Encoding UTF8 "$env:USERPROFILE\.codex\attachments\pasted-text-attachments.json" Then fully quit and reopen the Codex app. This may point to first-run / missing-directory handling in the pasted-text attachment flow. The app logs showed fs/readFile failing with os error 3 while trying to load pasted text attachment state.

That worked great!

santhoshkumar-dev · 1 month ago
> I found a local workaround that fixed this on Windows. > The large-paste path appears to use a managed pasted-text attachment registry under: > $env:USERPROFILE.codex\attachments\pasted-text-attachments.json > On the affected machine, the whole .codex\attachments directory was missing. Creating the directory and initializing the registry file fixed large text paste after restarting Codex: > New-Item -ItemType Directory -Force "$env:USERPROFILE.codex\attachments" > '{"attachmentPaths":[],"pendingRemovalPaths":[],"textExcerptsByPath":{}}' | Set-Content -NoNewline -Encoding UTF8 "$env:USERPROFILE.codex\attachments\pasted-text-attachments.json" > Then fully quit and reopen the Codex app. > This may point to first-run / missing-directory handling in the pasted-text attachment flow. The app logs showed fs/readFile failing with os error 3 while trying to load pasted text attachment state. That worked great!

Works for me as well 26.609.71450 version and also here's the one liner

New-Item -ItemType Directory -Force "$env:USERPROFILE\.codex\attachments"; '{"attachmentPaths":[],"pendingRemovalPaths":[],"textExcerptsByPath":{}}' | Set-Content -NoNewline -Encoding UTF8 "$env:USERPROFILE\.codex\attachments\pasted-text-attachments.json"

PolarGoose · 1 month ago

@zzccchen, @santhoshkumar-dev,

Thanks a lot for the workaround.
Now, when I paste ~6000 character long text, it gets attached as a file. Is it intended?