Skip to content

The EDIT/REPLACE tool is a disgrace; it deletes code and creates bad replacements. #18098

@Neinndall

Description

@Neinndall

What happened?

There are instances where, when Gemini attempts an edit, the replacement originates in code it shouldn't touch.

Other times, it makes correct replacements but then modifies sections of code and re-enters them, which leads me to believe the edit tool isn't very good. It needs to focus on the code it's supposed to modify.

Suppose you have a 300-line code snippet. If you ask Gemini to modify a section, sometimes it modifies the entire code in parts, copies and pastes a section of code into different sections, and then Gemini modifies what you requested, but by modifying the entire code.

Other times, it randomly deletes entire sections of code. It's frustrating because the edit tool has been very bad for months. That's all I can say.

Additionally, GEMINI has trouble reading and making replacements in code with more than 300 lines.

What did you expect to happen?

Good Edits.

Client information

About Gemini CLI

CLI Version 0.28.0-nightly.20260128.adc8e11bb
Model auto-gemini-3
Sandbox no sandbox
OS win32
Auth Method Logged in with Google

Login information

No response

Anything else we need to know?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stalearea/agentIssues related to Core Agent, Tools, Memory, Sub-Agents, Hooks, Agent Qualitystatus/need-triageIssues that need to be triaged by the triage automation.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions