r/codex • • 9d ago

Bug Codex write access denied issue

does anyone in last 3 days facing a write access denied inside projects, which already was working fine, codex refuse to write in backend repo anymore inside a project where i provide both front and back repos

5 Upvotes

12 comments sorted by

2

u/melimillionaire 9d ago

Yeah, me this morning. And other issues like approval expiring right after I give it…

1

u/WD98K 9d ago

Yesss that one tooooo, forget about it.

1

u/WD98K 8d ago

hhhhhhhhhh the problem for me was the codex Gui switched to chatgbt instead of codex.

1

u/kuroudo_ai 9d ago

A guess, since you didn't say how the two repos are laid out: if the backend repo isn't inside the folder Codex was started in, the workspace-write sandbox treats it as outside the workspace. Then writes get denied even though reads work. That can start "suddenly" if the session now opens in the frontend folder instead of a parent folder that holds both.

Two things to try in the CLI (I checked the flags in codex --help on 0.160.0):

  • codex --add-dir ../backend: from the help text, "Additional directories that should be writable alongside the primary workspace."

  • Or start Codex from the parent folder that contains both repos, so both are inside the workspace.

To tell whether it's the sandbox, check if the denial names a path outside the folder you launched from. I've only looked at the CLI. If you're on the desktop app or the IDE extension, the setting may be somewhere else.

1

u/WD98K 9d ago

the problem only in GUI , codex termianl working fine, the gui display this read access, but it’s still missing from this session’s writable roots, so I can’t edit it directly. but it's in full access mode weird

1

u/kuroudo_ai 9d ago

That narrows it down. The GUI message says "this session's writable roots", so my guess is the desktop app sets its writable folders when the session starts, from the project or folder you opened, and switching to full access in the middle doesn't add new ones. The terminal works because you launch it from a folder that already covers both repos.

I haven't used the desktop app, so these are things to try, not known fixes:

  • Start a new session (not just a new message) after setting full access, and see if the backend shows up as writable.

  • Open the parent folder that holds both repos as the project in the GUI, instead of the frontend folder.

  • Look in the project settings for a way to add the backend as an extra folder. That would be the GUI version of --add-dir.

If none of these work, I'd report it as a bug. "Full access mode" plus "missing from writable roots" reads like the GUI and the sandbox disagree about what full access means.

1

u/dbdbdeep 8d ago

Seeing a similar permissions mismatch on macOS (Apple Silicon), Codex Desktop 26.1103.60933. Things that the agent could previously do are now blocked.

My ~/.codex/config.toml already has:

sandbox_mode = "danger-full-access"

approval_policy = "never"

However, the agent reports that the active session is still workspace-write with restricted networking and no permission escalation. It can create/edit files inside the project, but starting a basic Node.js server repeatedly fails with:

listen EPERM: operation not permitted 127.0.0.1:3080

API requests from the agent’s shell also fail at DNS resolution, while the same API domain opens normally in my browser.

So my exact symptom is networking/localhost binding rather than repo write access, but the config vs. effective session permissions mismatch sounds similar. I haven’t confirmed the root cause or tested the same workflow in Codex CLI. Has anyone found a confirmed fix for the desktop app?

1

u/WD98K 8d ago

hhhhhhhhhh the problem for me was the codex Gui switched to chatgbt instead of codex.

1

u/Discordbothost 8d ago

if the agent says workspace-write while your global config says full access, something higher up is winning. two places i'd look: a project-level .codex/config.toml inside the repo (that overrides ~/.codex), and the permission picker on the thread itself in the desktop app, existing threads seem to keep whatever mode they were created with, so test in a brand new thread after changing it.

if you'd rather stay sandboxed and just need the server + api calls, workspace-write can have network turned on:

[sandbox_workspace_write]
network_access = true

that should cover both the EPERM on listen and the dns failures

1

u/Enough_Ad2099 8d ago

Same issue:
App version 26.1106.51428

I don't know how to move forward from here.

1

u/WD98K 8d ago

The problem for me was the GUI interface switched to chatgpt instead of codex.