Skip to content

message tool uses default media roots instead of agent-scoped roots #36185

Description

@ravz

Bug

The message tool's media path validation uses getDefaultMediaLocalRoots() instead of getAgentScopedMediaLocalRoots(), so files under the agent's configured workspace directory are rejected with LocalMediaAccessError: path-not-allowed.

Reproduction

  • Agent workspace: /home/rav/clawd (configured in agents.defaults.workspace)
  • File to send: /home/rav/clawd/daycare-enrolment-form.html
  • Channel: WhatsApp
  • Result: Local media path is not under an allowed directory

Expected

getAgentScopedMediaLocalRoots(cfg, agentId) in src/media/local-roots.ts already appends the agent workspace to the allowed roots. But the message/send tool path doesn't call it — it uses getDefaultMediaLocalRoots() which only includes ~/.openclaw/media, ~/.openclaw/agents, ~/.openclaw/workspace, ~/.openclaw/sandboxes, and the preferred tmp dir.

Workaround

Copy files to ~/.openclaw/media/outbound/ before sending.

Version

OpenClaw 2026.3.2 (85377a2)

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleMarked as stale due to inactivity

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions