Skip to content

Codex Desktop Settings cannot save approval/sandbox config after plugin marketplace refresh updates config.toml #24065

Closed

Description

@ddksql

Summary

Codex Desktop Settings > Configuration shows:

Configuration was modified since last read. Fetch latest version and retry.

This happens when trying to change:

  • Approval policy (approval_policy)
  • Sandbox settings (sandbox_mode)

The actual config file is editable and valid. The failure appears to be an optimistic concurrency/version conflict in the Settings UI: the page reads a config.toml layer/version, but Codex plugin/marketplace refresh updates the same ~/.codex/config.toml shortly after, so the Settings page keeps using a stale expectedVersion when calling write-config-value.

Environment

  • Product: Codex Desktop app
  • App version: 26.519.31651
  • Bundle id: com.openai.codex
  • OS: macOS 26.5
  • Architecture: arm64
  • Config file: ~/.codex/config.toml

Reproduction Steps

  1. Open Codex Desktop.

  2. Open Settings > Configuration.

  3. Select User config.

  4. Try to change Approval policy, e.g. Never -> On request.

  5. Try to change Sandbox settings, e.g. Read only / Full access.

  6. Observe red error text under the control:

    Configuration was modified since last read. Fetch latest version and retry.

Observed Behavior

  • The dropdown value may visually change, but saving fails with the error above.
  • Refreshing/reopening the settings page can still reproduce the issue if a background plugin/marketplace refresh modifies config.toml soon after the page reads it.
  • Editing ~/.codex/config.toml directly works.

Expected Behavior

Settings should either:

  • Refetch the latest config layer/version before writing, or
  • Retry the single-field upsert against the latest config after detecting a version mismatch, or
  • Ignore unrelated concurrent changes like marketplace last_updated when writing unrelated keys such as approval_policy and sandbox_mode.

Changing approval_policy and sandbox_mode should not fail because an unrelated marketplace timestamp changed.

Evidence

Sanitized ~/.codex/config.toml relevant fields:

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

[marketplaces.openai-bundled]
last_updated = "2026-05-22T10:51:24Z"
source_type = "local"
source = "<codex-home>/.tmp/bundled-marketplaces/openai-bundled"

[marketplaces.openai-primary-runtime]
last_updated = "2026-05-21T18:51:32Z"
source_type = "local"
source = "<user-cache>/codex-runtimes/codex-primary-runtime/plugins/openai-primary-runtime"

Enabled plugin entries include:

[plugins."computer-use@openai-bundled"]
enabled = true

[plugins."browser@openai-bundled"]
enabled = true

[plugins."chrome@openai-bundled"]
enabled = true

Relevant log patterns around the failure:

app-server request: config/value/write
app_server.request otel.name="config/value/write" rpc.method="config/value/write"
/etc/codex/managed_config.toml not found
Managed preferences for com.openai.codex key requirements_toml_base64 not found
failed to refresh remote installed plugins cache
failed to warm featured plugin ids cache
configured non-curated plugin no longer exists in discovered marketplaces during cache refresh plugin="browser" marketplace="openai-bundled"
configured non-curated plugin no longer exists in discovered marketplaces during cache refresh plugin="chrome" marketplace="openai-bundled"
configured non-curated plugin no longer exists in discovered marketplaces during cache refresh plugin="computer-use" marketplace="openai-bundled"

Suspected Cause

The Settings page passes a stale expectedVersion into write-config-value for approval_policy / sandbox_mode writes. The version becomes stale because plugin/marketplace refresh updates the same user config file, especially [marketplaces.openai-bundled].last_updated.

A local inspection of the bundled frontend showed the Settings code calls write-config-value with expectedVersion:B.expectedVersion for these fields. If any unrelated writer modifies config.toml after the settings page read, the write is rejected and the UI does not recover automatically.

Workaround

Manually edit ~/.codex/config.toml, for example:

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

Then restart Codex Desktop.

Notes

This does not appear to be caused by project-level instructions (AGENTS.md / agent.md) or project-level config. In this reproduction, the project had no .codex/config.toml and no project requirements.toml; logs also reported no managed config or MDM requirements key found.

Activity

  1. added
    bug
    app
    app-server
    config
    skills
    on May 22, 2026
  2. github-actions commented on May 22, 2026

    @github-actions
    Contributor
  3. bradleyhodges commented on May 24, 2026

    @bradleyhodges

    Also experiencing this issue with Codex 26.521.10419 on Windows.

  4. ys770 commented on May 25, 2026

    @ys770

    same :(

  5. marcfilleul commented on May 26, 2026

    @marcfilleul

    Same here on Mac OS. Codex version 26.519.41501. Fresh install.
    When editing config.toml and launching Codex, these two settings are deleted from the config file.

  6. MisterRound commented on May 30, 2026

    @MisterRound

    Adding a current Windows Desktop + WSL data point from the 26.527 build family.

    The same config-version conflict appeared while trying to disable the Computer use plugin from Settings. The UI showed a toast like Failed to update plugin, and Desktop logs showed the plugin state write failed because the config version was stale:

    Failed to update plugin enabled state
    Configuration was modified since last read. Fetch latest version and retry.
    

    Sanitized environment shape:

    Product: Codex Desktop Windows Store app
    Package family: OpenAI.Codex_26.527.x_x64__2p2nqsd0c76g0
    Mode: Desktop configured to run app-server in WSL
    Codex home: Windows profile path mounted into WSL as /mnt/c/Users/<user>/.codex
    

    The surrounding logs had active bundled marketplace/plugin reconciliation, including mixed Windows/WSL path symptoms tracked in #24268. That matches this issue's suspected cause: Settings has an expectedVersion, background plugin/marketplace refresh mutates config.toml, and then the user-facing write is rejected instead of re-reading/retrying.

    Suggested fix still looks the same: on configVersionConflict, Settings should refetch the latest config version and retry the single-field write, or batch/serialize config updates so unrelated marketplace/plugin timestamp changes do not break user settings changes.

  7. summer521521 commented on Jun 6, 2026

    @summer521521

    Adding a current Windows Store Desktop data point from the 26.602 build family, with a local file-watch reproduction.

    Environment:

    Product: Codex Desktop Windows Store app
    App package: OpenAI.Codex_26.602.4764.0_x64__2p2nqsd0c76g0
    Desktop app reported runtime: 26.602.40724 in generated config env
    OS: Windows
    Codex home: C:\Users\<user>\.codex
    Config file: C:\Users\<user>\.codex\config.toml
    No project-level .codex/config.toml in the active workspace
    No separate config.toml found under ProgramData, AppData\Roaming, or AppData\Local
    

    Observed UI behavior:

    • Settings > Configuration > User config shows the red error text:
    Configuration was modified since last read. Fetch latest version and retry.
    
    • The error appears when changing either:
      • Approval policy
      • Sandbox settings
    • Restarting Codex Desktop does not reliably clear the problem.

    Important local observation: the config file is not read-only and the UI can write it. A 60-second PowerShell watcher on config.toml showed the Settings UI successfully wrote the approval setting, then a second unrelated Codex background write changed the same file shortly after.

    Watcher output, sanitized:

    WATCH_START 2026-06-06 15:31:19 hash=55963D4A55B0666831B6120E7947085E27377304A3D8828EF2BDAE8718B8D776
    CHANGE 2026-06-06 15:31:26.770 LastWrite=2026-06-06 15:31:26.738 hash=DA28FBFBE35BD13B1818F448279C98DE40FD842278A8C50E6585FB5FF90093C4
      approval_policy :: 'approval_policy = "never"' -> 'approval_policy = "on-request"'
    CHANGE 2026-06-06 15:31:37.973 LastWrite=2026-06-06 15:31:37.804 hash=A38B510A85D3643D494610132DA6D9C5D8627C9600574622E81206A7A0695355
    WATCH_END 2026-06-06 15:32:19 hash=A38B510A85D3643D494610132DA6D9C5D8622E81206A7A0695355
    

    After the second write, the relevant top-level fields were still:

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

    The unrelated second write added/updated a feature flag in the same file:

    [features]
    workspace_dependencies = true

    This supports the suspected expectedVersion / optimistic-concurrency failure: the user-facing settings write can succeed, but another Codex background writer mutates config.toml while the Settings page is still holding an older version. The Settings page then reports a stale-version conflict instead of refetching and retrying the single-field write.

    Additional state mismatch observed in local app state:

    • config.toml top-level values after the UI write:
    approval_policy = "on-request"
    sandbox_mode = "danger-full-access"
    • .codex-global-state.json still had the current thread cached with a different permission shape:
    {
      "approvalPolicy": "on-request",
      "sandboxPolicy": {
        "type": "workspaceWrite",
        "writableRoots": ["C:\\Users\\<user>\\Documents\\Codex"],
        "networkAccess": false
      }
    }

    So this does not look like filesystem permissions or invalid TOML. It looks like multiple app-side config/state writers are not coordinated, and the Settings UI does not recover from a version conflict caused by unrelated config updates.

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

Metadata

Metadata

Labels

appapp-serverbugconfigskills

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions