google-gemini / google-gemini/gemini-cli

Bug Report: Discrepancy Between Edit Tool CLI Output and Actual File Changes

Open
#25,783 4 comments 1 reaction 0 assignees View on GitHub
area/agent kind/bug priority/p1 Stale status/bot-triaged type/bug
Dominant language
TypeScript
Stars
107k
Forks
14.6k
Avg merge
2d 3h
Merged PRs (30d)
45

Description

### What happened?

Recently, I've noticed a bug with the Edit tool on the Gemini CLI. When it was instructed to update my document files with new information or make amendments, it used the Edit tool and displayed the changes it made, which I was satisfied with. However, when I checked GitHub to view the changes, only half of what Gemini reported was actually reflected; the rest were missing. When I told it to try again and verify the work, it used the Write tool instead, which worked, but the issue remains that Gemini is hallucinating that it made changes to the file when it actually didn't. Since it did show the Edit function call, it seems like there could be an issue with the Edit tool itself rather than Gemini. Gemini even mentioned that there appears to be an issue with the Edit tool.

### What did you expect to happen?

I expected all stated changes to have actually been applied to my documents.

### Client information

Client Information

Run `gemini` to enter the interactive CLI, then run the `/about` command.

```console
> /about
# paste output here
```
About Gemini CLI
│ CLI Version: 0.38.2
│ Model: gemini-3.1-pro-preview
│ Sandbox: no sandbox
│ OS: win32
│ Auth Method: Signed in with Google
│ Tier: Gemini Code Assist in Google One AI Pro
│ IDE Client: Antigravity

### Login information

│ Auth Method: Signed in with Google
│ Tier: Gemini Code Assist in Google One AI Pro

### Anything else we need to know?

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.