← Back to PRs

#19171: fix(feishu): pass mediaLocalRoots to sendMediaFeishu for agent-scoped workspaces

by whiskyboy open 2026-02-17 13:33 View on GitHub →
channel: feishu size: XS
## Problem The Feishu outbound adapter's `sendMedia` handler does not pass `mediaLocalRoots` from the `ChannelOutboundContext` to `sendMediaFeishu`. This causes `loadWebMedia` to use default allowed roots, which explicitly block `workspace-*` directories (a security hardening added in the media path validator). As a result, non-default agents (e.g., agent `zxx` with workspace at `~/.openclaw/workspace-zxx/`) cannot send files via Feishu — the upload fails with: ``` Local media path is not under an allowed directory: /home/weitian/.openclaw/workspace-zxx/file.xlsx ``` Other built-in channels (Telegram, Discord, Slack, Signal, iMessage) correctly pass `mediaLocalRoots` through their outbound adapters. ## Fix - **`outbound.ts`**: Destructure `mediaLocalRoots` from the outbound context and pass it to `sendMediaFeishu`. - **`media.ts`**: Accept `mediaLocalRoots` in `sendMediaFeishu` params and forward it as `localRoots` to `loadWebMedia`. <!-- greptile_comment --> <h3>Greptile Summary</h3> This PR fixes the Feishu outbound adapter to correctly pass `mediaLocalRoots` from the `ChannelOutboundContext` through to `sendMediaFeishu` and then to `loadWebMedia`. Without this fix, agent-scoped workspaces (e.g., `workspace-zxx`) could not send files via Feishu because the media path validator's default allowlist explicitly blocks `workspace-*` directories. - `outbound.ts`: Destructures `mediaLocalRoots` from the context and passes it to `sendMediaFeishu` - `media.ts`: Accepts `mediaLocalRoots` in `sendMediaFeishu` params and forwards it as `localRoots` to `loadWebMedia` - The change is minimal, well-scoped, and consistent with how all other built-in channels (Telegram, Discord, Slack, Signal, iMessage) handle `mediaLocalRoots` <h3>Confidence Score: 5/5</h3> - This PR is safe to merge — it's a minimal, well-understood bug fix that aligns Feishu with all other channel adapters. - The change is a 2-file, ~6-line fix that threads an existing parameter (`mediaLocalRoots`) through the Feishu adapter, matching the exact same pattern used by Telegram, Discord, Slack, Signal, and iMessage. The types are correct (`readonly string[]` matches the context and `WebMediaOptions`), no new security surface is introduced, and no existing behavior changes for the default workspace. - No files require special attention <sub>Last reviewed commit: 1a8b9a2</sub> <!-- greptile_other_comments_section --> <sub>(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!</sub> <!-- /greptile_comment -->

Most Similar PRs