Description
Support sending images and files from the agent back to Discord as native attachments. Currently OpenAB only supports inbound attachments (Discord → agent via base64 ImageContent blocks, PR #158), but the outbound path (edit_message) only writes .content(text) with no CreateAttachment.
Use Case
- Agent captures a screenshot (e.g. via
peekaboo on macOS) and posts it back to the thread
- Agent generates a chart, diagram, or report and shares it visually
- Agent produces a file (CSV, PDF) and attaches it to the reply
Current workaround: The agent calls the Discord REST API directly via curl with the bot token to POST multipart form data. This works but is hacky — agent needs the bot token and channel ID, messages land outside OpenAB's thread context, and it's not portable across agents.
Proposed Solution
Detection: Agent response contains  markers (markdown image syntax, natural for LLM agents).
Handling in discord.rs:
- Parse agent response for file markers via regex
- Validate: file exists, size ≤ 25 MB (Discord limit), path in allowlisted directories only (security)
- Upload via serenity
CreateAttachment::path()
- Strip markers from text content
- Send attachments as follow-up messages
Security:
- Path allowlist (e.g.
/tmp/, agent working dir) to prevent exfiltration
- Size cap at Discord's 25 MB limit
- Rate limit on attachments per message
Environment: OpenAB v0.7.2, macOS + launchd multi-agent (Claude/Cursor/Codex/Copilot). Confirmed with maintainer on Discord that PRs are welcome.
Happy to submit a PR after feedback on detection format and security model.
Description
Support sending images and files from the agent back to Discord as native attachments. Currently OpenAB only supports inbound attachments (Discord → agent via base64 ImageContent blocks, PR #158), but the outbound path (
edit_message) only writes.content(text)with noCreateAttachment.Use Case
peekabooon macOS) and posts it back to the threadCurrent workaround: The agent calls the Discord REST API directly via
curlwith the bot token to POST multipart form data. This works but is hacky — agent needs the bot token and channel ID, messages land outside OpenAB's thread context, and it's not portable across agents.Proposed Solution
Detection: Agent response contains
markers (markdown image syntax, natural for LLM agents).Handling in
discord.rs:CreateAttachment::path()Security:
/tmp/, agent working dir) to prevent exfiltrationEnvironment: OpenAB v0.7.2, macOS + launchd multi-agent (Claude/Cursor/Codex/Copilot). Confirmed with maintainer on Discord that PRs are welcome.
Happy to submit a PR after feedback on detection format and security model.