Codex Desktop: "Failed to attach large pasted text" / Russian UI: "Не удалось прикрепить большой фрагмент вставленного текста"

Open 💬 3 comments Opened Jul 3, 2026 by arturmarkelov

What version of the Codex App are you using (From “About Codex” dialog)?

26.623.13972.0

What subscription do you have?

Plus

What platform is your computer?

Windows 10

What issue are you seeing?

Codex Desktop for Windows
Version: 26.623.13972.0
OS: Windows
Error: "Не удалось прикрепить большой фрагмент вставленного текста"

The error appears in any thread, including a brand-new thread.
Reinstalling Codex Desktop from Microsoft Store did not help.
Clearing local Codex app state/cache did not help.
Archiving old large threads did not help.
The same pasted text works in Cursor / other editors.

<img width="1121" height="993" alt="Image" src="https://github.com/user-attachments/assets/556b76e5-4e3b-4bba-9313-6dfa67120aff" />

It's just driving me crazy! it worked good until i upgraded the app - everything was broken after it - first i just cannot paste any text - even 10 rows - get "Failed to attach large pasted text" at once! I can paste only pics! Second - it started hang my laptop so Ctrl + Alt + Del doesn't work. Reinstalling the app via Mic Store not archiving big chats didn't work out.

What steps can reproduce the bug?

What is the expected behavior?

_No response_

Additional information

Problem
Codex Desktop fails when pasting text that should be converted into a pasted-text attachment. The error happens even in a brand-new chat and even after reinstalling Codex from Microsoft Store.
What We Tried
Checked whether this was caused by one bad thread
Created/used a brand-new Codex chat.
The same paste error appeared there too.
Conclusion: not caused by only one broken conversation.

Archived old/heavy Codex threads
Archived several large/not-loaded threads:019e0e39-0a6d-74a1-af92-ebe35b01b010
019eeebd-e02b-78e1-b852-6214dbbd5c92
019e830e-80c2-7090-8697-c39016df1142

Error still remained.
Conclusion: old chat history was not the root cause.

Cleared Codex Desktop web/browser state
Cleaned Codex Desktop Chromium profile/cache areas:%APPDATA%\Codex
%APPDATA%\Codex\web\Codex\Default
browser cache
IndexedDB
Local Storage
Service Worker cache
blob storage
GPU/network/temp cache

Created repair script:tools/repair-codex-desktop-paste.ps1
tools/repair-codex-desktop-paste.cmd
tools/repair-codex-desktop-paste-hardreset.cmd

Added backup and “Press Enter to close” behavior.
Error still remained.
Conclusion: not just browser cache.

Tried hard reset / Store app state cleanup
Added cleanup for Microsoft Store package cache/temp state:%LOCALAPPDATA%\Packages\OpenAI.Codex_2p2nqsd0c76g0\LocalCache
%LOCALAPPDATA%\Packages\OpenAI.Codex_2p2nqsd0c76g0\TempState
optional LocalState

Error still remained.

Tried reinstall path
Created reinstall/reset tooling:tools/reinstall-codex-desktop.ps1
tools/reinstall-codex-desktop.cmd
tools/reinstall-codex-desktop-admin.cmd
tools/reset-codex-desktop.cmd
tools/reset-codex-desktop-admin.cmd

Reinstall from Microsoft Store / installer did not fix the issue.
Conclusion: issue survived reinstall because important state was outside the Store app cache.

Checked clipboard-format theory
Hypothesis: clipboard contained hidden HTML/rich formats causing Codex to fail.
Added tools:tools/inspect-clipboard-formats.ps1
tools/inspect-clipboard-formats.cmd
tools/normalize-clipboard-plain-text.ps1
tools/normalize-clipboard-plain-text.cmd

These were meant to inspect or force plain Unicode text.
This was rejected as not the real fix.
Later evidence showed clipboard was not the root cause.

Created temporary workaround
Added clipboard/file bridge:tools/codex-clipboard-file-bridge.ps1
.cmd launchers

It saved large clipboard text into:_codex_work\codex_clipboard\codex-paste-*.txt

Then it replaced clipboard contents with a short file reference.
This avoided Codex’s broken large-paste attachment path.
It was only a workaround, not the real fix.

Inspected installed Codex Desktop app code
Searched inside:C:\Program Files\WindowsApps\OpenAI.Codex_26.623.13972.0_x64__2p2nqsd0c76g0\app\resources\app.asar

Found the actual large-paste code path:UI converts large paste into an attachment.
It calls:create-pasted-text-attachment-for-host
createPastedTextAttachment
pastedTextAttachments.create(...)

Found the exact toast message:composer.fileAttachment.pastedTextError
English default: Large pasted text could not be attached

Identified how Codex stores pasted-text attachments
Codex writes pasted text into:codexHome\attachments\<uuid>\pasted-text.txt

It also maintains a registry:codexHome\attachments\pasted-text-attachments.json

On this machine, codexHome is:C:\Users\Admin\.codex

View original on GitHub ↗

3 Comments

arturmarkelov · 1 month ago

<img width="616" height="72" alt="Image" src="https://github.com/user-attachments/assets/7c198400-d95e-4390-9c58-0a349a00b04f" />

arturmarkelov · 1 month ago

Found the real root cause
The broken file was:C:\Users\Admin\.codex\attachments\pasted-text-attachments.json

It was about 216 KB.
It started with NUL bytes.
ConvertFrom-Json failed with:invalid JSON primitive

Codex Desktop only handles “file missing” properly, but not “file exists and is corrupted”.
So every large paste failed before Codex could create the new pasted-text.txt.

Mahkhmood9 · 1 month ago
ConvertFrom-Json failed with:invalid JSON primitive

ConvertFrom-Json is powershell https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/convertfrom-json?view=powershell-7.6

why?
my idea behind this comment , is to argue - but in the future - how should common folk should use the app without getting cofused (should be there a fallback? should the codex-app change idea if a user attempts to upload large files [without the ground reality that there is a better way to deal with the task - the users tries to do - which is easy for llm to achieve quickly in todays standards ])

make sure you are concive with what you want --- try read and then explain to yourself what was the older project was about
that being said Codex desktop can be nice for some people (Pasting files count as contextwindows/tokens) -- I recomend manually placing the files (unless you are trying to make a shortcut or tool) if you are just trying to get things done just place them in a folder , start a new chat and let codex do the magic

i see you atttached history.md reminder it will treat it as a file ,, not as a prompt
@arturmarkelov my suggestion for you is , just try to explain and ask it --- and be literal with what you want
I understand you got some .json file you want to do something with ? what you want , codex is really powerful - you can ask it to use python and then for it to create you an excel sheete -- or to notice interesting things in the data you give it ( you also have sidenote /plan or /goal --- but jsut talking to it and mentioning files in your project --- should work --- but I dont recomend using the codex-desktop --- unless your prompts are short )

solution 2# I also recomend disabling this bridge:tools/codex-clipboard-file-bridge.ps1 skill? I dont think its a good idea as it is modifing an application that changes heavily every 5 days (dont use it --- ) you can try just utilize core feature

if you insist ("I want to use the history.md" you can refer to it "explain to me what this @history.md is about and summrize" --- and it lightly scans the file - and you next prompt I want to do this thing I want to have this and this ,,, I want this output ,,, "I want to use this data" ) alternatively you can just make (use "history.md" , after you read it -- I want you to do this this thing with @file.json )

  1. if the .json file is really corrpt manually leting codex-harness could be the better alternative

2.1. I argue you want codex to use its tool-calling -- because it should be able to deal with corrpt files -- use regex use grep maybe execute a little powershell or python file --- to mutate the data into a currect format (for whatever your orignal prompt and target was)

  1. (you can argue , what if I want to upload a .docx a large .pdf) which I dont have an answer and for this you should play with the various features the software offer (and ways to achieve it) , ((it reminds me the era macos when it was big and the idea of floating windows seemed a bit novel ))

the bridge:tools/codex-clipboard-file-bridge.ps1
is a thirdparty tool - not an openai tool

(I recomend use the Codex-ide , not the desktop app)

I personally recomend using the cli/ide version
https://developers.openai.com/codex/ide

there is
https://developers.openai.com/codex/workflows
which mention the workflow

meaning pasted files treated as context thus , its recomended you put files in the folder ---
<img width="1122" height="114" alt="Image" src="https://github.com/user-attachments/assets/242b1bb2-d806-4406-8887-6c3bfcbd9fe3" />

whats your end goal, a project - summerization ? I recomending starting fresh (click "new chat") and not attach files this way --
just add files to your folder you are working on

root@bsd:/tmp/schoolproject# touch whatever3.md
root@bsd:/tmp/schoolproject# touch whatever2.md
root@bsd:/tmp/schoolproject# ls
whatever2.md whatever3.md

(prompt "Please refect to this 5 files, I want you ??to explain?? ??To do this with X.json files?? or ??I want this or this??")

im not really a user of the CODEX APP --- just make sure you make a new project that has normal access to files--- like a .git report or a code project

<img width="1827" height="697" alt="Image" src="https://github.com/user-attachments/assets/a9be3fa3-1570-4420-9852-c0257536d8ff" />

in codex there is this thing called Threads --- and its a bit of a different expirence (Why? it doesnt force you to have a folder -- its a bit annoying navigating the files within the repo/project)

I can recomend you to try the ide ---- my guess you you try to agument and play with data or refrence older chats --- but I recomend you just make a new folder put your files there -- and use the codex ide which seems to make a lot less issues ... dont for to have a goal and target -- what you want to achieve and build with codex :)

<img width="1024" height="576" alt="Image" src="https://github.com/user-attachments/assets/38bfe891-c888-41f4-8ce9-829c15af4e93" />

<img width="1270" height="551" alt="Image" src="https://github.com/user-attachments/assets/c5bebeb3-7e7d-4ac7-a663-ebd81a8da817" />