Skip to content

[Bug] edit tool reports 'failed' but file is actually modified #45770

@jackycxl

Description

@jackycxl

Description

The edit tool sometimes returns a failure message ("Edit failed") even though the file was actually successfully modified. This has been observed multiple times (2026-03-12, 2026-03-14).

Steps to Reproduce

  1. Use the edit tool to modify a file
  2. The tool returns "⚠️ 📝 Edit: in (XX chars) failed"
  3. However, grep verification shows the file was actually modified successfully

Expected Behavior

If the edit is successful, the tool should return a success message. If it fails, it should return a clear failure reason.

Actual Behavior

  • Tool returns "failed" but file is modified
  • This causes confusion about whether the operation succeeded
  • Workaround: Use grep to verify if file was actually modified

Environment

  • OpenClaw version: 2026.3.12
  • macOS
  • Channel: Discord (observed)

Logs

From gateway.err.log:

Note: This log entry shows a "failed" message, but grep confirms the file was modified successfully.

Additional Context

This is a false positive - the operation actually succeeds but the tool reports failure.

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