Files
slacker-bot/plan/attachments-into-container.md
T

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_share are dropped today (bot.onEvent only takes messages with no subtype). Accept file_share too.
  • For each entry in files[], download url_private_download with 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 like import_home / write_import. It's the mirror of read_file in send-files-to-user.md, so build the two together. It's an additive call name in manager/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.