Summary
When an iMessage includes an image attachment, the agent attempts to analyze it via the image tool. The attachment path points to ~/Library/Messages/Attachments/..., which is not in the hardcoded media local roots. This causes a LocalMediaAccessError: path-not-allowed and the agent cannot process any iMessage image attachments.
Environment
- OpenClaw version: 2026.4.1 (da64a97)
- Channel: iMessage
- OS: macOS (Darwin 25.4.0 arm64)
Error
[tools] image failed: Local media path is not under an allowed directory:
/Users/.../Library/Messages/Attachments/.../file.pluginPayloadAttachment
Root Cause
buildMediaLocalRoots() in web-media-CkaAIY0r.js only allows:
- Preferred tmp dir
~/.openclaw/media
~/.openclaw/workspace
~/.openclaw/sandboxes
There is no config option to add additional allowed paths, and the iMessage channel plugin does not copy attachments into an allowed directory before passing them to tools.
Suggested Fix
Either:
- Config option: Add a
tools.media.localRoots (or similar) config key to allow users to add custom allowed directories
- Channel-level fix: Have the iMessage channel plugin copy attachments into
~/.openclaw/media/ before passing them to tools
- Automatic widening: When a channel plugin provides an attachment path, automatically add that path's parent to the allowed roots for that tool invocation
Option 2 seems safest - the channel plugin already knows about the attachment and can stage it.
Version
OpenClaw 2026.4.1 (commit da64a97)
Summary
When an iMessage includes an image attachment, the agent attempts to analyze it via the
imagetool. The attachment path points to~/Library/Messages/Attachments/..., which is not in the hardcoded media local roots. This causes aLocalMediaAccessError: path-not-allowedand the agent cannot process any iMessage image attachments.Environment
Error
Root Cause
buildMediaLocalRoots()inweb-media-CkaAIY0r.jsonly allows:~/.openclaw/media~/.openclaw/workspace~/.openclaw/sandboxesThere is no config option to add additional allowed paths, and the iMessage channel plugin does not copy attachments into an allowed directory before passing them to tools.
Suggested Fix
Either:
tools.media.localRoots(or similar) config key to allow users to add custom allowed directories~/.openclaw/media/before passing them to toolsOption 2 seems safest - the channel plugin already knows about the attachment and can stage it.
Version
OpenClaw 2026.4.1 (commit da64a97)