1013 B
1013 B
Attachments into the container
Files attached to a message to the bot (images, logs, zips) end up in the container, so the agent can use them.
- Message events with
subtype: file_shareare dropped today (bot.onEventonly takes messages with no subtype). Acceptfile_sharetoo. - For each entry in
files[], downloadurl_private_downloadwith the bot token (files:read), and write it to/root/slack-uploads/<message ts>/<name>. - Add the paths to the prompt text:
(Attached: /root/slack-uploads/…/report.pdf). - Writing needs a node operation,
write_file(machine, path), that streams chunks likeimport_home/write_import. It's the mirror ofread_filein send-files-to-user.md, so build the two together. It's an additive call name inmanager/cluster.go, and old slaves get a polite "this node can't take attachments yet". - Size cap: reuse
max_send_file_mb. The home's btrfs quota still applies, so an upload that doesn't fit fails with a clear message.