Skip to content

Windows: Force delete without confirmation #8567

@448523760

Description

@448523760

What version of Codex is running?

0.77.0

What subscription do you have?

no subscription

Which model were you using?

custom

What platform is your computer?

Microsoft Windows NT 10.0.26100.0 x64

What issue are you seeing?

The force delete functionality behaves inconsistently between Windows and Linux platforms when --ask-for-approval on-request is configured. On Windows, the operation executes without requesting user confirmation, while on Linux, a similar force delete operation (rm -rf) properly prompts for approval.

If such commands are executed without an explicit user confirmation step, the system may delete these files directly, increasing the risk of accidental or unintended file loss.

What steps can reproduce the bug?

Windows Platform:

  1. Create a test directory structure:

    mkdir test
    echo "content" > test/test.txt
  2. Make test.txt read-only:

    attrib +r test/test.txt
  3. Verify that direct deletion is blocked (without admin privileges):

    cd test
    rm test.txt
    # Expected: Error - "You do not have sufficient access rights to perform this operation"
  4. Run codex with -a on-request and tell it to remove the test

    cd ..
    codex -a on-request
    
        › delete the test folder
        
        
        • I'll help you delete the test folder. Let me first check what's in the current directory and then remove the test
          folder.
        
        • Ran Get-ChildItem -Force
          └
        
            … +8 lines
        
        
        
        ─ Worked for 4s ────────────────────────────────────────────────────────────────────────────────────────────────────────
        
        • Ran Remove-Item -Path 'test' -Recurse -Force
          └ (no output)
        
        ─ Worked for 6s ────────────────────────────────────────────────────────────────────────────────────────────────────────
        
        • Ran Get-ChildItem -Force
          └
        
            … +7 lines
        
        ```
    
    

What is the expected behavior?

ask user to approval before execute the command

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLIIssues related to the Codex CLIbugSomething isn't workingsandboxIssues related to permissions or sandboxingwindows-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