[Linux/Desktop] Copy button in Deep Research and in-app browser fails with DOMException
Summary: Clicking the Copy button in a Deep Research report (mcp_app_sandbox) or in the built-in browser fails with DOMException (NotAllowedError). The session uses browser permission mode, but setPermissionCheckHandler still runs and returns false for clipboard writes.
What version of the Codex App are you using (From "About Codex" dialog)?
26.1111.21308 (openai-codex-desktop 26.1111.21308-1 on Arch Linux, --ozone-platform=wayland)
What subscription do you have?
Plus / Pro
What platform is your computer?
Linux 7.2.15-1-omarchy x86_64 unknown (Arch Linux, Hyprland 0.56.2, Wayland)
What issue are you seeing?
When I click Copy in a Deep Research report (connector_openai_deep_research), nothing copies to the clipboard. The desktop log records this error:
INFO mcp_app_sandbox.console_message level="error" line=410 message="Failed to copy report contents [object DOMException]" sourceId="https://connector-id-<redacted>.web-sandbox.oaiusercontent.com/"
WARN App reported a runtime error connectorId=connector_openai_deep_research errorMessage="Failed to copy report contents"
Root cause in 26.1111.21308
I checked .vite/build/early-bootstrap-226-2f6bd181558008cf.js and found three causes:
-
setPermissionCheckHandleroverrides browser permission mode: Indl(partition),e.permissionHandlingis"browser". Theif ("browser" === e.permissionHandling)block setssetPermissionPromptHandlerandwill-request-permission, but there is noelsebefore the Electron handlers:if ("browser" === e.permissionHandling) { // sets setPermissionPromptHandler and will-request-permission } let allowLocalNetwork = (wcId, perm, url) => { let state = wcId == null ? null : getSandboxState(wcId); return "electron" === e.permissionHandling && "local-network" === perm && ...; }; e.setPermissionRequestHandler((wc, perm, cb, details) => cb(allowLocalNetwork(wc.id, perm, details.requestingUrl)) ); e.setPermissionCheckHandler((wc, perm, url) => allowLocalNetwork(wc?.id, perm, url) );When
e.permissionHandlingis"browser","electron" === e.permissionHandlingisfalse. Both handlers returnfalseand block Chromium's"clipboard-sanitized-write"check fornavigator.clipboard.writeText().The built-in browser session (
persist:codex-browser-app) has the same bug:e.setPermissionPromptHandler(this.options.onPermissionPrompt); e.setPermissionRequestHandler((e, t, r) => { r(false); }); e.setPermissionCheckHandler(() => false); -
clipboardWritedoes not map"clipboard-sanitized-write": In.vite/build/early-bootstrap.js,clipboardWritemaps only"clipboard-write". Chromium checks"clipboard-sanitized-write"fornavigator.clipboard.writeText(). Also,connector_openai_deep_researchdoes not declareclipboardWrite, sowill-request-permissioncallse.preventDefault(). -
Deep Research also blocks report downloads: In the same widget, clicking Download opens a
?app=skybridgeiframe that fails CSP (frame-src 'none'). The sandbox session also cancelswill-download(mcp_app_sandbox.download_blocked).
What steps can reproduce the bug?
- Start the ChatGPT / Codex app (
26.1111.21308) on Linux with--ozone-platform=wayland. - Open a chat with a Deep Research report (
connector_openai_deep_research). - Click the Copy button in the report.
- Run
wl-pasteand check~/.local/state/codex/logs/.../codex-desktop-*.log.
What is the expected behavior?
Clicking Copy in Deep Research or in the built-in browser copies the plain text to the system clipboard.
Additional information
When I allow "clipboard-sanitized-write" and "clipboard-write" in those permission handlers locally, the Copy button works as expected.
The missing else explains the copy failure, and it has a wider blast radius than this button.
Both handlers are installed unconditionally, so the sandbox keeps a check handler that answers false for every permission, not just clipboard. Media capture, notifications, fullscreen and clipboard read are denied the same way, and because the check handler suppresses any prompt, the sandbox sees a plain denial with no user-visible reason. Anything that depends on a permission granted through the browser path is affected, not only Deep Research.
Two details matter in the fix. Delegate from both handlers, since a check can be answered before a request is raised depending on the permission and platform. And match the exact permission string: Electron distinguishes clipboard read, clipboard write, and the sanitized write name used on some platforms, so a delegate that whitelists one name still denies the call.
As a second layer, the sandbox page can fall back to the legacy execCommand copy path inside the iframe when the async call rejects, which keeps the button working even when the host bridge is misconfigured.