Skip to content

Edit tool fails with exact match requirement - no retry logic #44210

@spadesv

Description

@spadesv

Description

When using the edit tool, if the oldText does not match exactly (including whitespace and newlines), the edit fails with an error. There is no staleness detection or retry mechanism.

Expected behavior

The tool should either:

  1. Detect if the file was modified between read and edit
  2. Provide a retry option
  3. Show current file content on match failure

Related Issues

Workaround

Using exec + echo/append to write to files instead.

Environment

  • OpenClaw version: 2026.3.11
  • Node: 22.22.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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