Skip to content

Edit tool fails with "old_string does not appear in file" due to fileContentCache never being populated #209

@0bserver07

Description

@0bserver07

When using claude-code-acp with an ACP client that implements readTextFile, the Edit tool fails
with:
Error: The provided old_string does not appear in the file: "..."

Even when the file clearly contains the text. (I tried .html but also .txt)

Reproduction steps:

  1. Connect an ACP client that implements readTextFile and writeTextFile
  2. Ask Claude to edit a file (e.g., "change the title in index.html from X to Y")
  3. Claude reads the file successfully
  4. Claude attempts to edit → fails with the above error

Root cause:
Two issues:

Root cause #1 - Caching condition never true:

Root cause #2 - Unhandled exception:

Where the actual error is thrown:

Fix branch: https://github.com/0bserver07/claude-code-acp/tree/fix/edit-tool-cache-bug

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Bugs

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions