Skip to content

Permission denied error and model gets confused #1875

@antoyo

Description

@antoyo

Describe the bug

Hi.
Sometimes I will get a "Permission denied" error when selecting "No, and tell Copilot what to do differently".
This seems to only happen with a few OpenAI models including gpt-5.4 (medium), gpt-5.2-codex, gpt-5.2 (high) and gpt-5.3-codex; Opus models do not seem to have this issue.

Affected version

v0.0.384 to v0.0.423, possibly more.

Steps to reproduce the behavior

A possible reproducer for this bug.
With this file:

fn main() {
  let var;
      let var2;
}

Prompt: Manually align this code.
Then, when seeing the diff, chooses "No, and tell Copilot what to do differently" and say: "Align with 8 spaces".

I got:

Failed to apply patch: Error: Permission denied: Update file /home/user/tests/copilot-bug/src/main.rs

and then the model goes off the rail:

◐ Inspecting permissions

  I'm facing a "permission denied" issue, and I'm considering whether I need to use bash with Python or perhaps a command like `cat > file` to address it. I should check
  the file permissions to see if it's writable. Maybe the `apply_patch` function lacks the necessary permissions, but bash might not have the same issue. I think I need to
  try using a bash command, like `perl -0pi`, but first, I should clarify my intent with the tool.

And it can continue for a while trying to investigate the "permission issue" but will never consider the user feedback.

Expected behavior

Choosing "No" should not cause a "Permission denied" error.
It should always cause The user rejected this tool call. User feedback: Align with 8 spaces (I sometimes get this with this reproducer, so try multiple times if you cannot reproduce).

Additional context

A workaround for this is to use --allow-all-paths and typing your feedback in the prompt after the task is over, but then you don't get to manually approve every edit.

Thanks to fix this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions