Skip to content

Cline attempts to use str_replace_editor instead of replace_in_file when using VSCode LM API with Claude Sonnet #4027

@KelvinChung2000

Description

@KelvinChung2000

What happened?

When using Cline with VSCode LM API and Claude Sonnet 4, Cline attempts to use a tool called str_replace_editor instead of the built-in replace_in_file tool for file editing operations. This tool doesn't exist in Cline's codebase. Even when prompted to use the correct Cline tools or when .clinerules specify to use Cline tools, the behavior is inconsistent - sometimes it uses the correct tool, sometimes it doesn't. After the 3.17.9 update, when prompted to use the advised tool, Cline pretends to use the tool but doesn't actually perform the file write operation, suggesting an interface problem between Cline and the LM API.

Steps to reproduce

  1. Use Cline with VSCode LM API and Claude Sonnet 4
  2. Give Cline a task that requires file editing
  3. Observe that Cline attempts to use str_replace_editor instead of replace_in_file
  4. Try prompting Cline to use the correct Cline tools
  5. Notice inconsistent behavior - sometimes works, sometimes doesn't
  6. After version 3.17.9, when prompted to use the advised tool, observe that Cline appears to use the tool but file changes are not actually applied

Relevant API REQUEST output

N/A

Provider/Model

vscode-lm / claude-sonnet-4

Operating System

linux 6.12.10-76061203-generic

System Info

VSCode: 1.100.3, Node.js: v20.19.0, Architecture: x64

Cline Version

3.17.9

Additional context

The user has verified that str_replace_editor doesn't exist in Cline's codebase and has added instructions in .clinerules to use Cline tools specifically. The issue appears to be related to how Cline interfaces with the VSCode LM API when using Claude Sonnet 4. The problem has worsened after version 3.17.9, where tool calls appear to execute but don't actually perform the intended file operations.

Metadata

Metadata

Assignees

Labels

Help WantedExtra attention is needed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions