Skip to content

Edit tool messes with indentation (but this is not shown in the diff) #14612

@joeldrapper

Description

@joeldrapper

Description

It looks like whenever the agent uses the edit tool, it replaces all tab indentation with two tabs. I was able to reproduce this with a simple one-line edit. The diff showed the correct edit but all tabs in the file had been replaced with two tabs.

Plugins

no

OpenCode version

1.2.10

Steps to reproduce

  1. Have a file that uses single-tab indentation
  2. Ask agent to edit the file — any edit will do
  3. The diff will show the correct edit but the file will actually have had all \t replaced with \t\t.

I was editing a Ruby file with ruby-lap enabled.

Screenshot and/or share link

No response

Operating System

macOS

Terminal

Zed

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcoreAnything pertaining to core functionality of the application (opencode server stuff)

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