Decisions

Why the Slack plugin gives each agent an app of its own, and how it hears messages.

Why one Slack app per agent, in Socket Mode?

Slack shares a Socket Mode app's messages among whatever connects, so two agents on one app would each miss some. Each app is made from Link's manifest, and connect refuses an app another agent here, or running on a box, has. Socket Mode, because a public address for each agent would mean a tunnel just for Slack.

Where Slack pushes

On a machine that packs agents, which has a public address and runs each agent only while it answers, nothing can hold a socket for each: there the app is switched to a request URL and Slack pushes its events by the Events API, signed with the app's signing secret (Slack). At home it stays in Socket Mode, which needs no public address.

How does the Slack bridge hear messages?

In Socket Mode, with the app-level token lnk agent connect slack already asks for: the plugin opens the connection, so the user needs no public address and Link runs no web server for Slack. Each event is acknowledged at once, before the answer is written, so Slack doesn't send it again; one it sends again anyway is carried once. A thread is slack:<the direct message's channel id>, the conversation the answer goes back to. Discord's Gateway is the same kind of connection.