Skip to content

macOS Codex Desktop Settings show "Unable to save" for sandbox/approval config writes due to configVersionConflict #23264

Closed as duplicate

Description

@Xueziq

What version of the Codex App are you using (From “About Codex” dialog)?

Codex Desktop: 26.513.31313 Codex Desktop bundle version: 2867

What subscription do you have?

plus

What platform is your computer?

Platform: macOS 14.6.1, arm64

What issue are you seeing?

Changing user settings in Codex Desktop Preferences, especially sandbox / permissions / approval-related settings, repeatedly shows:

Unable to save

The config file itself is writable and can be manually edited. For example, manually adding this to $CODEX_HOME/config.toml works and is read by the CLI:

sandbox_mode = "workspace-write"

The CLI also parses the resulting config successfully.

Expected behavior

Codex Desktop Preferences should save sandbox/approval settings successfully.

If the config has changed since the Preferences page last read it, Desktop should recover by re-reading the latest config version and retrying the write, or by batching/serializing related writes so they use the current config version.

Actual behavior

Desktop Preferences reports Unable to save.

Desktop logs show repeated config/value/write failures with:

error={"code":-32600,"data":{"config_write_error_code":"configVersionConflict"},"message":"Configuration was modified since last read. Fetch latest version and retry."}
method=config/value/write

Redacted log evidence

The following snippets are from:

~/Library/Logs/com.openai.codex/2026/05/18/*.log

Sensitive identifiers and local details are not included beyond the generic method/error fields.

2026-05-18T04:56:31.437Z error [electron-message-handler] Request failed
error={"code":-32600,"data":{"config_write_error_code":"configVersionConflict"},"message":"Configuration was modified since last read. Fetch latest version and retry."}
method=config/value/write
2026-05-18T07:06:09.657Z error [electron-message-handler] Request failed
error={"code":-32600,"data":{"config_write_error_code":"configVersionConflict"},"message":"Configuration was modified since last read. Fetch latest version and retry."}
method=config/value/write
2026-05-18T07:10:09.537Z error [electron-message-handler] Request failed
error={"code":-32600,"data":{"config_write_error_code":"configVersionConflict"},"message":"Configuration was modified since last read. Fetch latest version and retry."}
method=config/value/write

There are many repeated occurrences across several Desktop log files from the same day.

What steps can reproduce the bug?

Reproduction steps

  1. Start Codex Desktop on macOS.
  2. Open Preferences / Settings.
  3. Change a setting that writes to $CODEX_HOME/config.toml, such as sandbox mode or approval-related settings.
  4. Observe that the UI shows Unable to save.
  5. Check ~/Library/Logs/com.openai.codex/....
  6. Observe config/value/write failures with config_write_error_code=configVersionConflict.

Workaround

Manually editing $CODEX_HOME/config.toml works. For example:

sandbox_mode = "workspace-write"

This confirms the problem is not a basic filesystem permission failure. It appears to be a Desktop Preferences/app-server config write version conflict.

What is the expected behavior?

No response

Additional information

will this be fixed in next codex app version

Activity

  1. added
    app
    on May 18, 2026
  2. added
    bug
    app-server
    sandbox
    on May 18, 2026
  3. github-actions commented on May 18, 2026

    @github-actions
    Contributor
  4. LewisHam-code commented on May 22, 2026

    @LewisHam-code

    I can reproduce the same config write conflict on a newer macOS Codex Desktop build, and I have a bit more evidence that the setting may be partially persisted even while the UI keeps showing the stale-version error.

    Environment:

    • Codex Desktop: 26.519.31651 (CFBundleVersion 3017)
    • Bundled CLI: codex-cli 0.133.0-alpha.1
    • macOS: 26.5 (25F71)
    • Architecture: arm64
    • Host: local Codex Desktop, user config scope

    Reproduction:

    1. Open Codex Desktop Settings.
    2. Go to custom config.toml settings / user config.
    3. Toggle Allow network access under Workspace write.
    4. The UI shows:
    Configuration was modified since last read. Fetch latest version and retry.
    

    Observed behavior:

    • The UI continues to show the red error and does not appear to recover by fetching the latest config version.
    • However, the attempted toggle can still partially or fully persist underneath.
    • After toggling network access off in the UI, I observed all three local state sources change consistently to disabled:
    # ~/.codex/config.toml
    [sandbox_workspace_write]
    network_access = false
    // ~/.codex/.codex-global-state.json, current workspace/thread state
    "networkAccess": false
    -- ~/.codex/state_5.sqlite, active thread row
    select json_extract(sandbox_policy, '$.network_access') ...
    -- result: 0

    Earlier in the same session I manually set the same three sources to enabled and verified:

    • config.toml had network_access = true
    • .codex-global-state.json had no bad current-workspace networkAccess != true records
    • state_5.sqlite had no current-workspace workspace-write thread rows with network_access != 1
    • codex doctor reported config load OK and sandbox network enabled

    After using the Settings UI again, the value changed to false but the UI still displayed the config version conflict. That suggests the core issue is not just a file permission or SQLite persistence problem. The UI/app-server path appears to perform a write with a stale expectedVersion, then does not refresh/retry after the conflict, leaving the settings page stuck even when the underlying setting has changed.

    I also inspected the packaged frontend bundle locally and found the Settings page path keeps a layer expectedVersion and passes it to write-config-value for the network toggle (sandbox_workspace_write.network_access). On conflict, the UI displays the error, but from observed behavior it does not refresh the config layer/version and retry.

    Expected behavior:

    • On configVersionConflict, the Settings page should re-read the latest config layer/version and retry, or invalidate/refetch the config query before allowing another save attempt.
    • If a write has partially succeeded, the UI should reconcile with the actual persisted config instead of continuing to show a stale error state.
    • The user should be able to turn this setting on/off from Settings without needing manual edits or app restarts.

    This is still reproducible in 26.519.31651 / 0.133.0-alpha.1.

  5. Marabun commented on May 28, 2026

    @Marabun

    I can reproduce this on a newer macOS Codex Desktop build, with an additional symptom: the Settings UI can partially persist the change, then keep rejecting subsequent user-initiated edits with the stale-version error.

    Environment:

    • Codex Desktop: 26.521.10419
    • Codex CLI: 0.134.0
    • macOS: 26.5 (25F71)
    • Architecture: arm64
    • Scope: local Desktop app, User configuration (~/.codex/config.toml)

    Reproduction observed:

    1. Open Codex Desktop Settings > Configuration.

    2. Select User configuration.

    3. Change approval policy / sandbox settings through the dropdowns.

    4. The UI shows:

      Configuration was modified since last read. Fetch latest version and retry.
      
    5. Closing and reopening Settings does not reliably recover the form state.

    6. Subsequent attempts to change the dropdowns can keep failing with the same stale-version message.

    Observed state transitions from the local config file:

    • Initial intended state was:

      approval_policy = "never"
      sandbox_mode = "danger-full-access"
    • After trying to change values in the Settings UI, the config reached intermediate/changed states such as:

      approval_policy = "on-request"
      sandbox_mode = "danger-full-access"

      and later:

      approval_policy = "on-request"
      sandbox_mode = "workspace-write"
    • codex doctor --summary then reported the changed effective mode, e.g. restricted fs + enabled network · approval OnRequest, confirming the file was modified despite the UI still showing the stale-version error.

    Expected behavior:

    • If the Settings page writes one config value successfully, it should update its internal config version/revision before the next write.
    • If another process changes config.toml, the UI should provide a visible reload/refetch action or automatically refetch and retry the requested single-field update.
    • User-initiated dropdown changes in the official Settings UI should not leave approval_policy and sandbox_mode in a partially changed state.

    This seems like the Settings page is keeping the original config read-version after either its own write or a nearby background config update, then treating the next user action as a configVersionConflict.

  6. etraut-openai commented on Oct 13, 2026

    @etraut-openai
    Contributor

    (response from codex)

    Thanks for confirming this on macOS. Closing in favor of #20538, which tracks the same Preferences error after one config write succeeds and subsequent writes use a stale config version. This is not a file-permission issue; your report shows the same partial-persistence behavior for sandbox and approval settings on macOS. Please follow #20538 for progress.

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

    appapp-serverbugsandbox

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions