Repository navigation
Description
Summary
Within a single Codex desktop task, the effective permission state (activePermissionProfile, approvalPolicy, approvalsReviewer, writableRoots) silently degrades over successive turns — even when no files, settings, or the model are changed, and even though the on-disk config.toml defaults never change. Over three consecutive read-only status requests in one task, the state went from the correct configured profile down to bare :workspace with sandbox_approval: false and almost all writable roots removed.
This was independently confirmed by reading .codex-global-state.json directly, not just from the app's own self-reported status — the per-thread heartbeat entry in the state file matches the degraded values exactly.
Environment
Platform: Windows, Codex desktop app (please fill in exact build number from Settings → About — omitted here since it wasn't captured during the investigation)
Account: authenticated via ChatGPT; no organization-managed requirements.toml or managed_config.toml present at any documented system/user location
config.toml throughout this entire test: approval_policy = "on-request", approvals_reviewer = "user", default_permissions = "husum-property-files" — unchanged at every turn
Steps to reproduce
Start a new Codex task with a profile that has an explicit default_permissions set in config.toml (in this case, a custom profile husum-property-files).
Ask for a read-only status report of activePermissionProfile, approvalPolicy, approvalsReviewer, sandbox approval status, and writable roots.
Without making any file changes, permission changes, or model changes, ask for the identical read-only status report again.
Repeat once more.
Observed behavior (this run)
Turn 1 Turn 2 Turn 3
activePermissionProfile husum-property-files (extends :workspace) null / missing :workspace
approvalPolicy "on-request" "on-request" {"granular": {"sandbox_approval": false, "rules": false, "skill_approval": false, "request_permissions": true, "mcp_elicitations": true}}
approvalsReviewer "user" "user" "user"
writableRoots 7 entries, including the task folder, F:\Pictures\My Pictures, two OneDrive project folders, and .codex\memories same 7, plus an unrequested broader root (C:\Users\Dave Gibney\Documents\Codex, the parent of the task folder) only the task's own temp visualization directory — all 6 other roots gone, including F:\Pictures\My Pictures
Turn 3's values were independently verified against .codex-global-state.json → electron-persisted-atom-state.heartbeat-thread-permissions-by-id["<thread-id>"] directly on disk, and match the app's self-report exactly:
{
"activePermissionProfile": { "id": ":workspace", "extends": null },
"approvalPolicy": {
"granular": {
"sandbox_approval": false,
"rules": false,
"skill_approval": false,
"request_permissions": true,
"mcp_elicitations": true
}
},
"approvalsReviewer": "user",
"sandboxPolicy": {
"type": "workspaceWrite",
"writableRoots": ["C:\\Users\\<user>\\.codex\\visualizations\\2026\\08\\25\\<thread-id>"],
"networkAccess": false,
"excludeTmpdirEnvVar": false,
"excludeSlashTmp": false
}
}Expected behavior
A task's effective permission profile, approval policy, reviewer, and writable-root allowlist should not change between turns unless the user, the config, or the model changes. Three plain read-only status requests in the same task should return identical values each time.
Additional related finding (separate but adjacent bug)
Before the above was reproduced, a different desync was found and had to be manually patched: two host-scoped keys in the same state file — electron-persisted-atom-state.agent-mode-by-host-id.local and electron-persisted-atom-state.preferred-non-full-access-agent-mode-by-host-id.local — remained stuck at "guardian-approvals" (left over from earlier "Approve for me" usage) even after permission-selection-by-host-id:local was cleared and config.toml correctly specified approvals_reviewer = "user". As long as those two keys held "guardian-approvals", new tasks' approvalsReviewer came back as auto_review regardless of config.toml. This suggests the app keeps more than one on-disk representation of "current permission mode" per host, and they can desync from each other and from config.toml. Setting agent-mode-by-host-id.local to "auto" and preferred-non-full-access-agent-mode-by-host-id.local to null (matching a known-good backup from earlier the same day) resolved that specific symptom — approvalsReviewer correctly held at "user" through all three turns of the test above, even while the separate per-turn degradation (this report's main subject) still occurred.
Impact
Permission-dependent file operations (in this case, work on personal photo files) cannot be safely performed partway through a task, since the writable-root allowlist and sandbox approval behavior cannot be trusted to hold steady even across read-only turns. The only currently-known-reliable point is the first turn of a brand-new task.
Activity
github-actions commentedon Aug 25, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
gibney0164 commentedon Aug 25, 2026
Related: this looks like the same underlying issue as #33702 (macOS) and #23958 (Linux) — permission/reviewer/sandbox state desyncing or drifting mid-session without an explicit user action. Neither has a response either. Cross-platform (Windows/macOS/Linux) and going back to at least May suggests this is a core app-server bug, not something OS-specific
shevvek-chatgpt commentedon Nov 2, 2026
Additional Windows Desktop evidence from November 1–2, 2026: the current project can disappear from effective write permissions between turns while the named profile and model remain unchanged. This appears to match the disappearing-root aspect of this issue; I have not established a common root cause.
Environment:
Codex Desktop, bundled runtime0.166.0-alpha.5.1.gpt-6.1-sol.approval_policy=on-request,approvals_reviewer=auto_review.[windows] sandbox = "mxc". The exact Desktop application version and actual enforcement backend for each historical command were not independently verified.Configuration versus runtime state:
config.tomlselects the named profile throughdefault_permissions. It contains neithersandbox_modenorapprovals_reviewer;workspace-writeabove is the recorded runtimesandbox_policy.type, not an observed globalsandbox_modesetting.kind = "agent-mode"and
agentMode = "guardian-approvals". Its local agent-mode preferenceagrees. This is consistent with the runtime automatic reviewer, but I have
not traced how the UI selection and named profile are combined.
"." = "write"and".git" = "write"underfilesystem.":workspace_roots". Thus those project grants depend on theeffective workspace-root set. Other workspace directories have direct
path grants, which remain after the runtime-root list shrinks.
I inspected two local chats' persisted
thread_settings_appliedevents andturn_contextrecords:In both chats:
cwdremains<PROJECT>.runtime_workspace_rootsshrinks from the project, two additional workspace directories, and the chat's visualization directory to only the visualization directory.permission_profile.file_system.entriesloses the explicit write grants for<PROJECT>and<PROJECT>\\.git.active_permission_profile.id, model, approval policy, and reviewer remain recorded.workspace-write; the whole sandbox does not change toread-only. Other configured write paths still exist.The corresponding settings events already contain the reduced roots at 01:32:15.324 and 05:16:39.058 UTC, respectively. The current
heartbeat-thread-permissions-by-identries in.codex-global-state.jsonindependently corroborate the missing project Git write root for both chats.Chat B is particularly small: its first turn only searched documentation and public issues; the next turn requested log inspection and a sanitized report. There was no model switch, configuration mutation by the assistant, or request to reduce permissions in that interval. The current config file's modification timestamp predates both of B's turns. This is an observed sequence, not a deterministic minimal reproduction or proof of the initiating cause.
In chat A, a later project-local
Copy-Itemat 02:26:31 UTC returned access denied for two documentation destinations. Reads and writes to separately authorized workspace directories continued. This blocked saving completed project work.No raw rollouts, task contents, usernames, actual project paths, profile names, or chat identifiers are included here. Diagnosis was read-only with respect to configuration and security settings. Please investigate why applying per-chat settings can discard runtime workspace roots and their derived project grants while retaining the same named permission profile.
fallenleavesgocrunch commentedon Nov 3, 2026
Additional macOS evidence: a fresh Plan-mode chat loses its project root and write grant on the first follow-up, while the named permission profile remains unchanged.
Environment: macOS; bundled Codex runtime 0.166.0-alpha.5.1; Local chat in a saved project; Plan mode; managed permission profile workspace-development extending :workspace. Desktop app version was not independently checked.
Reproduction:
Expected: The checkout remains included and retains its existing write grant across turns.
Actual: The checkout disappears from workspace_roots and its explicit filesystem write entry disappears. cwd still points to that checkout. Plan mode and the active permission profile remain unchanged. The visualization root and Docker grant remain. A folder-boundary instruction then blocks further inspection. In another affected chat, test-report directory creation failed with PermissionError: [Errno 1] Operation not permitted.
Filtered log evidence (UTC, 2026-11-03; paths and chat IDs anonymized):
Only read-only inspection preceded the fresh reproduction: no tests, edits, mode switch, or worktree creation. Manually re-adding the project folder restored access in the earlier chat. The logs locate the transition but do not establish the underlying cause. Please investigate workspace-root propagation across turn submissions.
iamswain25 commentedon Nov 3, 2026
Also seeing this on macOS: the current worktree loses write permission on a later turn while
cwdremains unchanged. Codex then requests escalation or proposes a temporary worktree.Update (2026-11-11): The latest macOS release, 26.1106.51428 (build 26605), does not appear to address this issue. The affected follow-up workspace-root handling is still present in that build. I'm currently using a customized Codex app with this bug patched locally.
codestation commentedon Nov 4, 2026
Same on Linux with the ChatGPT app 26.1029.61003
dougludlow commentedon Nov 23, 2026
I reproduced the worktree write-root loss on macOS in Default collaboration mode. Desktop
26.1117.41037(build29803), bundled runtime0.171.0-alpha.13, macOS27.3on Apple Silicon. The chat used a local managed Git worktree and a named permission profile extending:workspace.Redacted excerpts from Desktop's
Reasoning summary turn-start config resolvedlog, with selected fields:The request counts describe overrides sent by Desktop. The app server's persisted
thread_settings_appliedrecords show the effective runtime roots going from the worktree plus four related checkout roots to only<chat-visualization-dir>. Thecwd, active named profile,workspace-writesandbox mode, and Default collaboration mode stayed the same. The worktree lost its write grant, fixed Git metadata and cache grants persisted, and four later turns retained the one-root configuration.Isolated reproduction. I ran the root-selection expression from the installed Desktop bundle in memory with synthetic paths and stubbed helpers. The fixture represents a local project-backed follow-up using the app server's permission defaults. In each case, the repository cwd and project roots are known.
[<chat-visualization-dir>][<managed-worktree>, <related-checkout>][<managed-worktree>, <related-checkout>, <chat-visualization-dir>]The first case matches the request shape and effective root in the live records. The in-memory test isolates how the client can send the replacement root. Why the live client failed to carry forward its roots and whether the same code path explains the earlier reports are still unverified. I did not replay the full Desktop interaction. A no-selection Page snapshot appeared near the transition, but the directory already existed on the first turn and this code path can add it independently of Page selection.
Cross-reference for the macOS report: #63435.
TonyGravagno commentedon Nov 24, 2026
Additional reproduction: Windows Codex Desktop -> WSL2 remote app-server, Codex 0.171.0
I'm experiencing what appears to be the same loss of effective workspace write permissions, but with the Windows Codex desktop app connected to a WSL2 Ubuntu instance via the Codex app-server.
Environment
common-projectpermission profile, with the project workspace configured for write access using:workspace_roots.Observed behavior
A fresh desktop session initially had write access to the project workspace. During subsequent tool executions, the shell's working directory unexpectedly changed from the project directory to a Codex-managed visualization directory under
~/.codex/visualizations/.The assistant subsequently reported that the visualization directory was its current workspace and that the original project directory was read-only.
An actual filesystem write operation confirmed the failure:
No child-agent spawn was observed in this reproduction.
Mount observations
Three successive shell executions ran in separate Linux mount namespaces:
EROFS.Separate mount namespaces are expected with per-command sandbox construction. The significant observation is that the project's writable mount disappeared between executions.
This suggests inconsistent propagation or reconstruction of effective workspace permissions rather than a change to the underlying filesystem's ownership or permissions.
Follow-up investigation
A Codex 0.171.0 diagnostic session completed several additional tests:
rgandsedsource inspection: passed.codex sandbox --permission-profile common-projecttesting: inconclusive. Configuration resolution initially failed withdefault_permissions requires a [permissions] table. An inline-profile retry reached Bubblewrap but could not complete because the enclosing sandbox had masked/tmp/codex-daemon-1000.The investigation did not reproduce the original failure again or identify its exact trigger.
Potential cause
The Codex 0.171.0 app-server code appears to allow runtime workspace roots to be replaced during turn processing. If the replacement list contains only the visualization directory, a named permission profile using
:workspace_rootscould retain its profile identity while losing the project write grant.Relevant source:
https://github.com/openai/codex/blob/rust-v0.171.0/codex-rs/app-server/src/request_processors/turn_processor.rs#L843-L862
Version 0.171.0 also includes PR #61195, preserving permission profiles across CWD updates. The observed failure occurred with 0.171.0 installed.
This is a hypothesis, not a confirmed root cause.
Expected behavior
The project's authorized writable workspace root should remain available throughout a session, regardless of read-only tool executions, CWD transitions, or the addition of a visualization directory.
Remaining investigation
An independent standalone CLI versus desktop/app-server comparison has not yet been completed. I don't think this is necessary given the evidence direct from the CLI and local app-server, but this is where I first noticed the anomaly. This report may help establish that the permission-loss behavior reported in this ticket also affects remote WSL Linux sandbox execution, with observable changes to the effective mount layout.
HTH