How OAB handles images, audio, and files sent by users across all platforms.
User sends media (photo/voice/file)
→ Platform webhook delivers to Gateway
→ Gateway downloads via platform API (auth stays in Gateway)
→ Image: resize ≤1200px, JPEG compress (GIF passthrough ≤5MB)
→ Store to ~/.openab/media/inbound/<uuid>
→ WS event includes file path in attachments[].path
→ Core reads from disk (zero encoding overhead)
→ Processes: image → LLM, audio → STT, text_file → code block
→ File auto-evicted after 2 minutes
| Platform | Images | Audio/Voice | Text Files | Video | Binary Files |
|---|---|---|---|---|---|
| Discord | ✅ | ✅ (STT) | ✅ | metadata only | skipped |
| Telegram | ✅ | ✅ (STT) | ✅ (whitelist) | skipped | skipped |
| Feishu | ✅ | ✅ (STT) | ✅ (whitelist) | skipped | skipped |
| Google Chat | ✅ | ✅ (STT) | ✅ (whitelist) | skipped | Drive files skipped |
| WeCom | ✅ | — | ✅ (whitelist) | skipped | skipped |
| LINE | ✅ (LINE-hosted only) | ✅ (STT, 1:1 only, LINE-hosted only) | — | — | — |
| Slack | ✅ | ✅ (STT) | ✅ | — | skipped |
- Gateway downloads from platform API
resize_and_compress()— longest side ≤1200px, JPEG quality 75- GIFs ≤5MB passed through unchanged (preserves animation)
- Stored to
~/.openab/media/inbound/<uuid> - Core reads bytes →
ContentBlock::Image→ sent to LLM
OpenAB can create the ACP image block, but downstream coding agents and selected models must also support image input. For local llama.cpp examples, see Local OpenAI-Compatible Vision Models.
- Gateway downloads raw audio (ogg/m4a/mp3)
- Stored to filesystem (no transcoding)
- Core reads bytes → STT transcription (Whisper/Groq) →
[Voice message transcript]: ... - If STT disabled: silently skipped
LINE-specific note:
- LINE voice-message STT currently works in 1:1 chats only.
- LINE group/room voice messages are still blocked by mention gating because LINE does not attach mention metadata to audio messages.
- Gateway downloads file
- Extension whitelist check:
.txt,.csv,.md,.json,.yaml,.rs,.py,.js,.ts,.go,.java,.c,.cpp,.sh,.sql,.html,.css,.toml,.xml,.ini,.cfg,.conf, etc. - UTF-8 validation — non-UTF-8 files rejected
- Stored to filesystem
- Core reads → wraps in markdown code block:
```filename.ext\n<content>\n```
Binary files (zip, pdf, exe, docx), video, and stickers are rejected with a status reason. The agent receives a [System: attachment "..." was not delivered — unsupported format: ...] notification so it can inform the user.
| Type | Max Size | Enforced By |
|---|---|---|
| Images | 10 MB | Gateway (pre-download Content-Length + post-download bytes) |
| Audio | 20 MB | Gateway |
| Text files | 20 MB | Gateway (same as store cap) |
| GIF passthrough | 5 MB | resize_and_compress() |
| Store (defense-in-depth) | 20 MB | store_media() |
Media is stored at ~/.openab/media/inbound/<uuid>:
- Filenames: Server-generated UUID v4, no extension (MIME type in event payload)
- TTL: 2 minutes — background task evicts expired files every 30 seconds
- Trust boundary: Gateway and Core share the same
$HOME(same pod / sidecar) - No auth required: Core reads directly from filesystem, no HTTP/token needed
- Path traversal: Impossible — filenames are UUID only, never user-supplied
- Token leakage: Platform auth tokens (Telegram bot token, LINE access token, Feishu tenant token) stay in Gateway, never reach Core or agent
- Disk exhaustion: TTL eviction + size limits prevent unbounded growth
- No executable content: Files are raw data, never executed
For separated deployments (Gateway ≠ Core pod), a future PR will add GET /media/<uuid> on the Gateway, allowing Core to fetch via internal HTTP. The attachments[].path field will be replaced by attachments[].url in that mode.
No additional configuration required. The filesystem store is always active when Gateway is running. Ensure Gateway and Core share the same $HOME (default in Helm colocate/sidecar mode).
- Local OpenAI-Compatible Vision Models — Local vision model setup for Pi and OpenCode
- Telegram — Telegram-specific behavior and limitations
- Feishu — Feishu image/file/audio handling
- Google Chat — Google Chat attachment support
- STT (Speech-to-Text) — Audio transcription configuration
- Sending Files (Outbound) — Agent → user file delivery (separate mechanism)