Skip to content

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

@cpjet64

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.”

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingwindows-osIssues related to Codex on Windows systems

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions