gemini-cli icon indicating copy to clipboard operation
gemini-cli copied to clipboard

Bug: Gemini CLI Fails to Execute File Modifications, Incorrectly States Inability to Edit Files

Open AntoSalazar opened this issue 1 year ago • 9 comments

What happened?

The Gemini CLI is exhibiting a critical bug where it claims it cannot modify local files, despite being designed to perform such operations (as demonstrated by its ability to read files and suggest changes). When instructed to implement changes or edit specific files, the CLI responds with:

"I'm sorry, but I cannot fulfill this request. I am an AI assistant and do not have the ability to modify your files."

This behavior prevents the user from utilizing the CLI's intended functionality to directly apply code modifications and guidance, leading to a broken workflow.

Steps to Reproduce

Initiate a conversation with the Gemini CLI.

Provide a task that involves modifying local files 

Observe the CLI's response.

What did you expect to happen?

Expected Behavior

Upon receiving instructions to modify files, the Gemini CLI should execute the requested changes to the specified local files . It should then provide confirmation of the successful modifications or details of any issues encountered during the file operations, without stating an inability to perform the action.

Actual Behavior

The Gemini CLI explicitly states that it "cannot fulfill this request" and "do[es] not have the ability to modify your files," effectively refusing to perform the intended file editing operations.

Impact

This bug severely limits the utility of the Gemini CLI, as a core feature (guided code modification and application) is non-functional. Users are forced to manually apply changes suggested by the CLI, negating a significant benefit of an AI-powered development assistant.

Client information

  • CLI Version: 0.1.13
  • Git Commit: 412b78c5 (local modifications)
  • Operating System: linux v23.11.1
  • Sandbox Environment: no sandbox
  • Model Version: gemini-2.5-pro
  • Memory Usage: 214.5 MB

Login information

Google account

Anything else we need to know?

No response

AntoSalazar avatar Jul 25 '25 17:07 AntoSalazar

Experiencing the same issue

joshuaMarple avatar Jul 25 '25 17:07 joshuaMarple

Experiencing the same issue :

yoo9857 avatar Jul 25 '25 18:07 yoo9857

Experiencing the same issue too what happend?

evelaguti avatar Jul 25 '25 18:07 evelaguti

Issues when away when using flash model

evelaguti avatar Jul 25 '25 21:07 evelaguti

Issues when away when using flash model

Same happened to me, let's see if tomorrow with the pro model doesn't happen again

AntoSalazar avatar Jul 25 '25 23:07 AntoSalazar

Experiencing the same issue too

SteveKibs avatar Jul 26 '25 07:07 SteveKibs

I'm seeing this as well. In my case I can only reproduce this with Gemini CLI configured to use Gemini models from VertexAI via LiteLLM proxy, as per LiteLLM docs here.

This is what happens when I run Gemini CLI over the LiteLLM proxy, asking it to generate GEMINI.md. It just prints the response to stdout w/o any tool calls.

Image

OTOH, when I run Gemini CLI with default Google auth and settings, it issues tool calls fine, starting with ReadFile and ending with WriteFile to write the generated GEMINI.md file to disk.

Image

For anybody else posting here, can you please describe your setup in more detail, how do you configure Gemini CLI, do you have LiteLLM proxy in the middle?

przem8k avatar Jul 29 '25 13:07 przem8k

I think this is the same issue as https://github.com/google-gemini/gemini-cli/issues/3562 , and on the LiteLLM side https://github.com/BerriAI/litellm/issues/12609

przem8k avatar Jul 29 '25 14:07 przem8k

Found possible duplicate issues:

  • #5047: (#0.9092605655944701)

gsquared94 avatar Jul 29 '25 23:07 gsquared94