Skip to content

edit.txt tool description has incorrect error messages #15888

@0x28F4

Description

@0x28F4

Description

edit.txt tells the LLM to expect error messages that don't match what edit.ts actually throws.

When oldString is not found:

edit.txt says:

"oldString not found in content"

edit.ts throws:

throw new Error(
  "Could not find oldString in the file. It must match exactly, including whitespace, indentation, and line endings.",
)

When oldString matches multiple times:

edit.txt says:

"Found multiple matches for oldString. Provide more surrounding lines in oldString to identify the correct match."

edit.ts throws:

throw new Error("Found multiple matches for oldString. Provide more surrounding context to make the match unique.")

edit.txt should be updated to match the actual error strings in edit.ts.

Plugins

None

OpenCode version

dev (latest, commit bc1fd06)

Steps to reproduce

  1. Open packages/opencode/src/tool/edit.txt and read lines 8-9
  2. Open packages/opencode/src/tool/edit.ts and read lines 649-654
  3. Compare the error strings — they don't match

Screenshot and/or share link

No response

Operating System

Windows 11

Terminal

Windows Terminal

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