Skip to content

Don't fail a delivered wait over its archive, and explain Codex desktop EPERM - #26

Merged
leonlee merged 4 commits into
mainfrom
fix/codex-desktop-eperm
Oct 31, 2026
Merged

leonlee merged 4 commits into
mainfrom
fix/codex-desktop-eperm

Conversation

@leonlee

@leonlee leonlee commented Oct 31, 2026

Copy link
Copy Markdown
Owner

What happened (elf-tower, Codex Desktop 0.166.0-alpha):

  • The desktop app gives each session its own sandbox. It allows writes to the workspace, ~/.codex/visualizations/… and the temp directories, and doesn't apply writable_roots = ["~/.pair"] from ~/.codex/config.toml.
  • Codex usually asks to run pair commands outside that sandbox. Once it didn't: pair wait delivered the approval, then failed to rename the thread into archive/ (EPERM) and exited 1.
  • The hint told the user to add the writable_roots line they already had.

Changes:

  • wait: when the result is delivered but archiving fails, it prints pair: warning: delivered, but couldn't archive the finished thread: … and exits 0. The thread stays closed in its lane; the next wait delivers it again, and the first one that can write archives it.
  • Codex hint: inside Codex (CODEX_THREAD_ID set), the channel EPERM/EACCES error adds that a session's sandbox, such as the desktop app's, may not apply writable_roots. It says to run the pair command outside the sandbox, or to give the session write access to the channel root.
  • Docs: README setup gets a note about the Codex desktop app, and DESIGN.md's Protocol section describes the warning.

Tests (112 pass):

  • A closed thread with the archive rename denied: exit 0, the message is on stdout, the warning on stderr, and the thread stays in its lane.
  • The Codex hint appears only with CODEX_THREAD_ID.
  • A later writable wait delivers the result again and archives it.

🤖 Generated with Claude Code

https://claude.ai/code/session_012Y3kg5hjT2zSZM9qUEEinM

leonlee and others added 4 commits October 31, 2026 20:44
…op EPERM

In the Codex desktop app, a session's sandbox can read ~/.pair but not write it, since the app
doesn't apply writable_roots. A pair wait run inside it delivered the approval and then exited 1
because the archive rename failed with EPERM, and the hint asked for the writable_roots line the
user already had.

wait now warns and exits 0 when it delivered the result but couldn't archive the thread; the
thread stays closed in its lane, and the next wait that can write archives it. Inside Codex, the
EPERM hint adds that a session sandbox may ignore writable_roots, and to run the pair command
outside it or grant the session write access. The README and DESIGN.md say the same.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012Y3kg5hjT2zSZM9qUEEinM
A wrong root or ordinary permissions can also cause EPERM, so the hint says the session's
sandbox may not apply writable_roots.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012Y3kg5hjT2zSZM9qUEEinM
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012Y3kg5hjT2zSZM9qUEEinM
The hint no longer repeats itself, the comment names the commands that archive a closed thread
(wait and send request), and the README only suggests granting access if the app allows it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012Y3kg5hjT2zSZM9qUEEinM
@leonlee
leonlee merged commit 6fed530 into main Oct 31, 2026
2 checks passed
@leonlee
leonlee deleted the fix/codex-desktop-eperm branch October 31, 2026 12:28
@leonlee leonlee mentioned this pull request Oct 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant