Skip to content

Edit tool returns misleading 'File not found' for paths outside workspace sandbox #30724

@Chrisr6records

Description

@Chrisr6records

Bug

The Edit tool silently rejects paths outside the current agent's workspace root, returning a misleading File not found error instead of the actual reason.

Steps to Reproduce

  1. Agent main (workspace: /home/winnie/.openclaw/workspace/) attempts to edit a file in another agent's workspace
  2. Use the Edit tool with the full absolute path: /home/winnie/.openclaw/agents/pm-frankel/workspace/AGENTS.md
  3. File is confirmed to exist via find, ls -la, and the Read tool

Observed Behavior

  • Read tool on the same path → ✅ works fine, returns file contents
  • Edit tool on the same path → ❌ File not found (misleading)
  • Write tool on the same path → ❌ Path escapes workspace root (correct error message)

Expected Behavior

Either:

  1. Preferred: Edit should return the same clear error as Write: Path escapes workspace root: /home/winnie/.openclaw/agents/pm-frankel/workspace
  2. Alternative: Edit should be allowed to write to other agent workspaces (same as Read can access them), since the orchestrator agent legitimately needs to update PM/dev agent workspace files

Impact

  • Causes confusion and wasted tool calls debugging a non-existent path problem
  • Workaround: use exec with cat > to write files outside the workspace sandbox
  • Inconsistent behavior across Read/Edit/Write tools for the same path

Environment

  • OpenClaw 2026.2.26
  • Multi-agent setup with separate workspace roots per agent
  • Agent main orchestrating updates to pm-frankel workspace files

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions