Skip to content

Codex Desktop secondary folder is not propagated to workspace_roots or writable permissions #35260

Open

Description

@pablobaldez

What version of the Codex App are you using?

26.721.41059 (build 5848)

What platform is your computer?

macOS 26.2, arm64

What issue are you seeing?

A folder added through the Codex Desktop UI as a secondary folder for an existing task is displayed as attached in the app, but it is not propagated to the task's effective sandbox context.

The secondary folder is absent from both:

  • environment_context.filesystem.workspace_roots
  • writable entries in permission_profile.file_system

The agent can inspect/read the sibling worktree, but writes fail with Operation not permitted and require out-of-sandbox approval. This produces repeated permission prompts even though the folder was already added through the app UI for that task.

Sanitized example of the injected context:

cwd: /path/project.worktrees/PRIMARY
workspace_roots:
  - /path/project.worktrees/PRIMARY
  # /path/project.worktrees/SECONDARY is missing

permission_profile:
  file_system:
    entries:
      - access: write
        path: /path/project.worktrees/PRIMARY
      # no entry for SECONDARY

A write into the secondary worktree then fails:

cp: /path/project.worktrees/SECONDARY/...: Operation not permitted

This appears to be a synchronization bug between the secondary-folder state shown by the Desktop UI and the permission/workspace state injected into an already-running task.

What steps can reproduce the bug?

  1. Open an existing Codex Desktop task whose primary folder is a Git repository or worktree.
  2. Create or select a sibling Git worktree outside the primary folder.
  3. Add that sibling worktree to the task using the Desktop app's secondary-folder UI.
  4. Confirm that the app shows the secondary folder as attached.
  5. Continue the same task and ask Codex to create or copy a file inside the secondary worktree.
  6. Observe an approval prompt or an Operation not permitted failure.
  7. Inspect the next turn's environment_context.
  8. Observe that the secondary folder is absent from workspace_roots and from the writable permission entries.

The problem persists across subsequent turns in the same task.

What is the expected behavior?

Once a secondary folder is attached to a task with write access:

  • it should be included in the task's workspace_roots;
  • it should receive the corresponding writable permission entry;
  • ordinary writes inside it should not require repeated escalation;
  • the effective permissions should update in the existing task without requiring the task to be recreated.

If secondary folders are intentionally read-only, they should still appear in the injected roots/permission context and the UI should clearly communicate that limitation.

Additional information

Related but distinct reports:

Activity

  1. added
    bug
    app
    sandbox
    on Jul 24, 2026
  2. nehal-spense commented on Oct 21, 2026

    @nehal-spense

    Additional diagnostic evidence from a macOS desktop session on October 21, 2026:

    • The user reports four repository folders attached to one project, but only the primary frontend repository is editable.
    • Removing and re-adding all four folders and fully quitting/reopening the application did not resolve the problem. The user also indicated they had tried a new chat.
    • A diagnostic in the affected existing session showed only the primary repository in its declared workspace roots and repository write permissions.
    • A uniquely named temporary file in that primary repository was created, written, read back successfully, and removed.
    • Secondary repositories were outside the session's declared writable roots. No write was attempted there, so this does not establish an OS-level write failure.
    • Attempts from that affected session to query project/thread metadata through the app tools failed with a generic Codex app tool request failure. Whether this is related is unknown.

    This supports investigating propagation of attached folders into session permissions. The four-folder attachment UI has not been independently verified by this diagnostic. No source files or permission configuration were changed. Exact app version and macOS version have not been collected. Private project names, repository names, and local paths are omitted.

  3. igorzep commented on Oct 23, 2026

    @igorzep

    Common, OpenAI!!! Working with multiple project/folders is a natural and absolutely every-day job of any real developer! It is impossible to use Codex and it is worse and worse with every new update! Make multiple folders working!

  4. scruffydan commented on Oct 27, 2026

    @scruffydan

    I have the same issue since updating to Version 26.1021.31345

  5. Sand-282 commented on Oct 29, 2026

    @Sand-282

    come on!! get this fixed!

  6. braincircuits commented on Nov 1, 2026

    @braincircuits

    Additional reproduction from macOS Apple Silicon, tested on November 1, 2026 (Asia/Shanghai).

    Current desktop version: 26.1027.51404, build 23880, read from the installed application's Info.plist (bundle ID com.openai.codex). The affected diagnostic conversation is running in the application's Work mode; this distinction may matter when comparing settings with the Codex configuration surface.

    The project attachment UI shows both a primary repository and a secondary folder. However, the effective session environment lists only the primary repository in workspace_roots and grants repository write access only to that primary path.

    Actual filesystem probes, with private paths replaced by labels:

    Location Directory listing Create/write/read back/delete a unique temporary file
    Primary repository Succeeds Succeeds
    Secondary sibling repository (attached in an earlier test) Succeeds Creation fails: PermissionError: [Errno 1] Operation not permitted
    Separate secondary test folder (shown attached in the latest test) Succeeds Creation fails: PermissionError: [Errno 1] Operation not permitted

    The successful temporary files were removed. No project source files or permission configuration were modified by the diagnostic probes.

    The same behavior was observed while using version 26.1021.31345 (21828), after rolling back to 26.1016.62342 (21477), and again with 26.1027.51404 (23880). These tests reused the same existing conversation; they do not establish fresh-session reproduction for every version or identify the version that introduced the problem.

    Settings screenshots showed Work mode local file access set to workspace write, and later the Codex sandbox setting set to full access and the general full-access permission enabled. The existing Work session still had the restricted effective roots and the same secondary-folder failure. This does not establish that settings failed to save; which settings apply to this surface, and whether existing sessions refresh their permissions, remain unresolved.

    Could you investigate propagation of attached project folders into the effective session permission profile, and clarify when permission changes apply to existing Work/Codex conversations?

    Local usernames, full paths, and unrelated logs have been omitted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    appbugsandbox

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions