Image paste fails with 'no image on clipboard' despite screenshot copy

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

What happened?

Pasting a screenshot/image into Codex repeatedly failed. The UI reported that no image was available on the clipboard, even though the user was attempting to paste a screenshot for debugging.

Observed error, repeated several times:

Failed to paste image: no image on clipboard: The clipboard contents were not available in the requested format or the clipboard is empty.

This blocked a normal debugging flow where the user needed to share a screenshot of Google Play Console.

Expected behavior

Codex should accept a copied screenshot/image from the clipboard, or provide a clearer fallback path when the clipboard content cannot be read.

At minimum, the error should distinguish between:

  • the OS clipboard actually being empty
  • the clipboard containing an image in an unsupported format
  • the Codex client failing to access the clipboard image
  • WSL/Windows clipboard interop limitations

Environment

  • Codex CLI: codex-cli 0.142.2
  • OS/session: WSL2 on Windows
  • Kernel: Linux BigFatty 6.18.33.1-microsoft-standard-WSL2 #1 SMP PREEMPT_DYNAMIC Fri Jun 5 01:12:21 UTC 2026 x86_64 GNU/Linux
  • Workspace path: /mnt/d/repos/fountainrank

Additional context

As a workaround, I tried to pull the image from the Windows clipboard through WSL with PowerShell, but Windows executable interop was not working in this session:

/bin/bash: line 1: /mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe: cannot execute binary file: Exec format error

That workaround failure is separate, but it made the missing image-paste support more disruptive because there was no usable in-chat path to attach the screenshot.

Repro steps

  1. Copy a screenshot/image to the clipboard.
  2. Attempt to paste it into Codex chat.
  3. Observe the paste failure:
Failed to paste image: no image on clipboard: The clipboard contents were not available in the requested format or the clipboard is empty.

View original on GitHub ↗

4 Comments

github-actions[bot] contributor · 2 months ago

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

  • #29580

Powered by Codex Action

aronweiler · 2 months ago

Additional clarification from the affected session: the core failure is that the user cannot paste an image into Codex at all.

The user repeatedly attempted to paste a screenshot for debugging, and Codex rejected it with:

Failed to paste image: no image on clipboard: The clipboard contents were not available in the requested format or the clipboard is empty.

This is not just a confusing error message. It blocks the basic workflow of sharing a screenshot with Codex when the UI being debugged cannot be described reliably in text.

aronweiler · 2 months ago

Severity clarification: this is blocking active work.

Impact:

  • The user cannot paste screenshots/images into Codex at all.
  • Screenshot-based debugging is unusable when the UI state cannot be described reliably in text.
  • The repeated clipboard error gives no actionable recovery path.
  • In this session, the failure directly blocked debugging a Google Play Console release issue.

This should be treated as an imperative workflow blocker, not a cosmetic clipboard-message bug.

Nicolas0315 · 2 months ago

I pushed a focused improvement for the WSL failure mode described here:

https://github.com/openai/codex/compare/main...Nicolas0315:codex/wsl-image-paste-fallback-error?expand=1

Commit: 6fa8c1aae5118f2427261b4380211b56f2ed5504

What changed:

  • The WSL image-paste path no longer discards Windows/PowerShell fallback failures and falls back to the original no image on clipboard message.
  • If native clipboard read fails and the WSL fallback also fails, the UI now reports both the native clipboard error and the Windows clipboard fallback error.
  • PowerShell fallback attempts now aggregate failures from powershell.exe, pwsh, and powershell, including execution errors like WSL interop/Exec format error, non-zero status, empty output, unsupported returned paths, or unreadable generated PNGs.
  • Added focused tests for the user-visible WSL fallback error and command-failure aggregation.

Validation:

  • Local Windows rtx4090: just fmt, git diff --check, cargo check -p codex-tui, cargo test -p codex-tui wsl_clipboard_fallback_error_display_preserves_both_contexts, and cargo test -p codex-tui clipboard_paste passed.
  • Local WSL Linux cfg test was attempted, but this WSL environment has no Rust toolchain installed (cargo: command not found).
  • cyberagent-mac-m5max over SSH: exact commit checkout, git diff --check, cargo test -p codex-tui clipboard_paste, and cargo check -p codex-tui passed.
  • nicolas2025 over SSH: exact commit checkout, git diff --check, cargo test -p codex-tui clipboard_paste, and cargo check -p codex-tui passed; no lingering cargo/rustc/link processes.
  • nicolas-macbook-pro over SSH: exact commit checkout and git diff --check passed; no Rust toolchain installed there.
  • rtx5060ti over SSH: exact commit checkout and git diff --check passed; cargo remains blocked by the host's existing linker setup (link.exe rejects MSVC-style arguments), with no lingering cargo/rustc/link processes afterward.