Channels¶
The cockpit (webview) is the default channel and needs no external platform. A chat
channel is an addition — one owner transport per agent, set with --channel, with the
cockpit alongside it.
| channel | owner transport | routing key | host service | needs |
|---|---|---|---|---|
| webview | the browser cockpit | --user-email |
webview-gateway + webview-login |
nothing external |
| telegram | a Telegram bot | --owner-id (or pairing) |
none (per-agent poller) | a bot token from @BotFather |
| teams | Microsoft Teams | --owner-aad |
teams-gateway |
an Azure app + a public messaging endpoint |
| slack | Slack DMs | --owner-email |
slack-gateway |
a Slack app (Socket Mode, no public URL) |
Quick start stands up webview.
Switching an agent's channel¶
Switching is a ledger scalar, not a rebuild. channel is one of the two scalars that
reconciles itself — agents set runs the apply for that agent, because the value bakes into
on-disk unit names:
sudo agentctl agents set <agent> channel webview # needs user_email set first; applies itself
channel webviewmakes the cockpit the only surface, so it requires auser_email— without one the gateway has no way to route to the agent, andagents setrefuses rather than leaving it with no channel at all.- A
user_emailon any other channel is additive — that agent gets a cockpit too. - Slack and Teams refuse to wire until their guarded secrets are set, and the refusal prints
the exact
secret setline with the value format (e.g.--value <xoxb-…>). Teams guards onlyTEAMS_APP_ID; its other two secrets are rendered if present and never refuse.webview-login installchecksWEBVIEW_HMAC_KEYand names it without a value format, andwebview-gateway installguards nothing.
How the agent talks to its channel¶
Both runtimes speak the same WebSocket frame protocol to the gateways, so a Slack, Teams or webview gateway serves either one without knowing which it is talking to. The channels, the routing keys and the lanes below are identical on both.
| runtime | unit | how a turn flows |
|---|---|---|
| pi (default) | pi-agent@<name>.service |
the agent process owns the channel directly — no PTY, no subprocess |
| claude | agent@<name>.service |
a shim process spawns claude and drives it over stdio |
On pi, apply renders PI_CHANNEL to select the transport. A telegram agent long-polls
the Bot API in-process; teams, slack and webview each dial the shared gateway over an
outbound WebSocket. An unrecognised PI_CHANNEL value is fatal at startup. The turn loop is
identical across all four. The Telegram client library is imported only on the telegram
branch, and apply prunes it from a non-Telegram agent's dependency tree after install.
A non-webview primary channel additionally gets the cockpit as an additive lane when
the host runs a webview gateway, and outbound replies fan out to both.
Lanes: how one agent carries several conversations¶
Every frame carries an optional session, normalized so that the empty string means the
primary lane.
RegisterFrame.session |
the authoritative routing key; gateways key their routing table on (agent, session) |
CHANNEL_SESSION (env) |
read by a channel process, which stamps its own lane onto every outbound frame |
"" |
the primary lane |
session is not a trust dimension. Authorization stays agent × owner-identity; a
lane selects which conversation a frame belongs to, never what the caller may do.
Adding a chat channel¶
| channel | install | secrets |
|---|---|---|
| webview | webview-gateway install · webview-login install, both behind your HTTPS proxy — see the cockpit |
WEBVIEW_HMAC_KEY + your auth driver's config |
| telegram | none; each agent runs its own poller | the per-agent bot token, passed at add time |
| slack | slack-gateway install (Socket Mode, no public URL) |
SLACK_BOT_TOKEN (xoxb-…), SLACK_APP_TOKEN (xapp-…) |
| teams | teams-gateway install (needs a public messaging endpoint) |
TEAMS_APP_ID (GUID, the one the install guards on), plus TEAMS_APP_PASSWORD and TEAMS_APP_TENANT_ID (GUID) for a working bridge |
Telegram, Slack and Microsoft Teams (click-through + CLI)¶
Telegram.
- Click: DM @BotFather → /newbot → copy the token.
- CLI: agentctl agents add <name> --channel telegram --bot-token <token>. --channel
telegram is required: webview is the default, so the token alone does not select
Telegram.
► PAIR: message the bot once and the owner is captured, or pass --owner-id to skip.
► LOGIN: the bot DMs an auth URL → authorize → paste the code back → the agent is live.
Slack.
- Click: api.slack.com/apps → Create (From an app manifest, or scratch) → Socket
Mode on → App-Level Token (connections:write) = SLACK_APP_TOKEN → OAuth &
Permissions bot scopes chat:write, reactions:write, users:read, users:read.email,
files:read → Install to Workspace → Bot User OAuth Token = SLACK_BOT_TOKEN → Event
Subscriptions → bot event message.im.
- CLI: Slack has no create-CLI; the "CLI" path is the app manifest (paste it in
step 1). Tokens are still minted by the Install button. Then:
secret set SLACK_BOT_TOKEN · secret set SLACK_APP_TOKEN · slack-gateway install.
Microsoft Teams.
- Click (Azure Portal): App registrations → New → copy Application (client) ID =
TEAMS_APP_ID, Directory (tenant) ID = TEAMS_APP_TENANT_ID → Certificates &
secrets → New client secret = TEAMS_APP_PASSWORD → Azure Bot resource →
Messaging endpoint = https://<teams-gateway-host>/api/messages → enable the Teams
channel → sideload the Teams app package.
- CLI (az): az ad app create --display-name agentctl-teams --query appId -o tsv
· az ad app credential reset --id <appId> --query password -o tsv
· az account show --query tenantId -o tsv · az bot create … · az bot msteams
create …. Then the three secret set … + teams-gateway install.
► TENANT: Teams is the one channel whose transport lives in your own Azure
tenant. The full sequence, the trust boundary and the cross-host runbook are in
The Teams gateway.
What is not a channel¶
A system an agent reads and writes — Google Workspace, Microsoft 365, Atlassian — is a capability it is wired into on whatever channel it already has, through an MCP and a login. Wiring one: MCPs. The per-provider OAuth setup: Logging an agent in.