Skip to content

Windows approval “Allow for this session” isn’t remembered #4212

Open

Description

@cpjet64

What version of Codex is running?

codex-cli 0.41.0

Which model were you using?

affects all models

What platform is your computer?

Microsoft Windows NT 10.0.26100.0 x64

What steps can reproduce the bug?

  1. Start Codex on Windows.
  2. Trigger any non–auto-approved command, e.g. a git init.
  3. In the approval modal choose “Always” / “Approve for this session.”
  4. Let the tool run, then issue the same command again.
  5. Codex asks for approval every time.

What is the expected behavior?

Once I approve “for this session,” any equivalent invocation during that session should run without another prompt.

What do you see instead?

Codex repeats the approval prompt because the stored command vector only matches the PowerShell-wrapped version that actually ran, not the original bash -lc … the UI shows and the model reuses.

Additional information

Bug reproduces reliably on Windows because exec command translation swaps the command vector before caching. Broad fix is to store both the displayed command and the executed command when the user approves “for this session.”

Activity

  1. added
    bug
    on Sep 25, 2025
  2. added
    windows-os
    on Sep 25, 2025
  3. beestinger72 commented on Sep 26, 2025

    @beestinger72

    pain in the neck for a first time user

  4. densy07 commented on Sep 26, 2025

    @densy07

    i have to use WSL

  5. panthernet commented on Sep 27, 2025

    @panthernet

    I have to use FullAccess for now and I'm scared

  6. Weijiang-Xiong commented on Sep 27, 2025

    @Weijiang-Xiong

    I have the same problem with MacOS and Win10, I'm sshing to a Linux computer.

  7. kuravista commented on Sep 29, 2025

    @kuravista

    i have same problem to..always clikc "aprove this session" every time. when forget use fullaccess

  8. tariqkhan051 commented on Sep 30, 2025

    @tariqkhan051

    same issue, even after clicking 'approve this session', it's asking again and again

  9. stavBodik commented on Sep 30, 2025

    @stavBodik

    Same here, Wating for fix, thanks developers !

  10. TVpoet commented on Oct 1, 2025

    @TVpoet

    same, please fix it

  11. jfbosch commented on Oct 2, 2025

    @jfbosch

    Same on win 11.

  12. YanX94 commented on Oct 7, 2025

    @YanX94

    Same Win11

  13. joserachetti commented on Oct 8, 2025

    @joserachetti

    Same problem on Win 10

  14. MrGeRoI commented on Oct 10, 2025

    @MrGeRoI

    I'm using full acess but i'm afraid it will mess up everything somehow

  15. Abdelkrim commented on Oct 14, 2025

    @Abdelkrim

    It is not normal that we have either to click on "allow this sessions" several times per prompt and grant access to the current project or to grant full access to our file system.

    this is not an acceptable choice !

    click on "Allow this session" should grant access to the current project only !

    Image
  16. 19 remaining items

  17. Maxed-Out-99 commented on Dec 22, 2025

    @Maxed-Out-99

    Chatgpt helped me install wls and run vs code from there. Had to put my project there which is not ideal but at least I can give a task and leave and it will be done when I come back 👍

  18. evenfrost commented on Dec 30, 2025

    @evenfrost

    This is still an issue with Cursor + Codex extension.

    Codex extension version: 0.4.56
    Cursor Version: 2.3.14
    VSCode Version: 1.105.1
    Commit: b3e9fe6c37659159fc2dec9ae643d74c25e5d0d0
    Date: 2025-12-29T23:26:25.365Z
    Electron: 37.7.0
    Chromium: 138.0.7204.251
    Node.js: 22.20.0
    V8: 13.8.258.32-electron.0
    OS: Linux x64 6.17.0-8-generic
    
  19. moritonal commented on Jan 7, 2026

    @moritonal

    Still happening for new Windows user. For large changes it makes the extension very annoying to work with

  20. christopherjnash commented on Jan 7, 2026

    @christopherjnash

    Also still having the same problem unfortunately... Anybody have a workaround that doesn't include WSL use?

  21. baochenw commented on Jan 9, 2026

    @baochenw

    Also still having the same problem on VS Code extension 0.4.58

  22. felipekjr commented on Jan 9, 2026

    @felipekjr

    Still happening on Ubuntu 20.04 and VS Code

  23. Jason5Lee commented on Jan 14, 2026

    @Jason5Lee

    Still happening on Windows. While working fine on macOS.

  24. etraut-openai commented on Jan 14, 2026

    @etraut-openai
    Contributor

    @Jason5Lee, have you tried enabling the Windows experimental sandbox?

  25. Olyno commented on Jan 15, 2026

    @Olyno

    Funny enough, i have the exact same issue on Fedora, Linux, via Codex CLI.

    It looks like Codex fails to edit a file properly, and it asks for permission, but when you select Yes, and don't ask again for these files, it keeps asking for this file. Kinda annoying.

  26. moritonal commented on Jan 16, 2026

    @moritonal

    Just a note for others, on my Windows machine with extension openai.chatgpt:0.4.60, I'm finding that if I edit C:\Users\user\.codex\config.toml and manually add

    [notice]
    hide_full_access_warning = true
    
    [projects.'C:\Users\user\Documents\GitHub\ProjectABC']
    trust_level = "trusted"
    

    Then it massively reduces the number of permission requests. However it still sometimes asks me for permission to write to files?? In these cases you can see in the console output the following:

    [error] [CodexMcpConnection] CLI: codex_core::codex: needs_follow_up: true
    [info] Received app server notification: codex/event/token_count
    [info] Received app server notification: thread/tokenUsage/updated
    [info] Received app server notification: account/rateLimits/updated
    [info] Received app server notification: codex/event/patch_apply_begin
    [info] Received app server notification: item/started
    [info] Received app server notification: codex/event/apply_patch_approval_request
    [info] Received server request: 1 item/fileChange/requestApproval object(keys=5)
    

    So one idea is that it's the backend that's driving the permission checks which also implies it could be per-model based, I'm on 5.2.

  27. WAY29 commented on Jan 17, 2026

    @WAY29

    same in WSL and vscode plugin

  28. added
    sandbox
    on Mar 16, 2026
  29. SylvainWinning commented on May 25, 2026

    @SylvainWinning

    I took another pass through this thread and the current reports. This issue may benefit from an explicit status split, because the comments now seem to cover more than the original Windows command-vector mismatch.

    The original report points to a concrete class of bug: the user approves the displayed command “for this session”, but the cached approval matches the translated/wrapped command that actually ran. On native Windows, where commands may be rewritten through PowerShell/cmd wrappers, that can make the next equivalent request miss the session approval.

    A focused regression test could cover:

    1. User-facing command is bash -lc ... or equivalent displayed text.
    2. Execution command is translated/wrapped for native Windows.
    3. User selects AcceptForSession.
    4. A later equivalent model request matches the prior approval whether it is compared against the displayed command, the executed command, or the normalized command identity.

    It would also help to separate the remaining reports by environment:

    • native Windows without experimental sandbox;
    • Windows + WSL remote workspace;
    • VS Code remote SSH into Linux;
    • macOS/Linux reports that may actually be file-change approval rather than command approval;
    • item/fileChange/requestApproval / apply_patch_approval_request cases, which may be a separate path from command execution approvals.

    That split could make it clearer whether this issue should stay focused on command approval caching, or whether a second issue is needed for file-change approval repetition.

    Per docs/contributing.md, I’m sharing analysis rather than opening an unsolicited PR. If maintainers want a repro artifact, the command-normalization regression test above seems like the smallest useful starting point.

  30. naipi11 commented on Aug 18, 2026

    @naipi11

    On native Windows, "Allow for this session" often fails because the UI stores the translated PowerShell command vector, then the next turn sends the original bash -lc ... form and the match misses.

    Method:

    1. Trust the project in ~/.codex/config.toml so repeated local commands stop hitting the prompt:
    [projects.'D:/path/to/repo']
    trust_level = "trusted"
    
    1. If the prompt is the Full Access warning rather than a per-command approval, add [notice] hide_full_access_warning = true.
    2. For unattended local work, set approval_policy = "never" or run that workspace under WSL, where session approvals do persist.
    3. Restart Codex after the config change.

    This reduces the prompt storm; it does not make the Windows session-approval matcher remember the pre-translation command.

    Independent community workaround; not an official OpenAI fix.

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

    bugsandboxwindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions