Skip to content

feat(agents): put an agent in a Slack channel - #7905

Open
benjaminshafii wants to merge 1 commit into
feat/agent-weekly-budgetsfrom
feat/agent-slack-channels
Open

benjaminshafii wants to merge 1 commit into
feat/agent-weekly-budgetsfrom
feat/agent-slack-channels

Conversation

@benjaminshafii

Copy link
Copy Markdown
Member

What is this about?

An agent can be put in a Slack channel, so a mention of the OpenWork bot there goes to that agent instead of the speaker's own assistant. Off by default behind agentSlackChannels.

The agent does not answer yet. This PR ships the channel binding and the check of who may talk to it. An allowed speaker gets "Agents can't answer in Slack channels yet, so nothing was run for this message."

What problem does it solve?

A team could not give a shared agent a home in a channel. A mention always ran the speaker's personal assistant.

What was the situation before?

flowchart LR
  M[Bot mention in channel] --> B{Channel has an agent?}
  B -- no --> P[Speaker's own assistant, as before]
  B -- yes --> A{Speaker can use the agent?}
  A -- no --> R[Private refusal, no model or tool call]
  A -- yes --> S[Private 'not yet' line, logged on the agent]
Loading

How is this implemented?

  • Migration 0234_personal_agent_slack_channel: one agent per workspace channel.
  • GET|POST|DELETE /v1/personal-agents/:id/slack-channels in routes/personal-agents/slack-channels.ts: owner or manager of the agent, plus connections.manage and a recent sign-in to change.
  • slack-assistant/worker.ts asks personal-agents/slack-channels.ts to claim a mention. The speaker is resolved through the existing Slack-user-to-member link and checked with the agent's existing sharing: owner, people it is shared with, its teams, or the organization. Anyone else, or an unlinked Slack user, costs nothing.
  • No new Slack scopes; channels are bound by id. Archiving the agent or disconnecting Slack removes the bindings.
  • openwork agents slack list|add|remove.
  • Flag and doc: packages/features/src/flags/agent-slack-channels.ts, docs/features/agent-slack-channels/README.md.

What else changed?

Release note

none

Evidence

  • No E2E spec: API and CLI only. agent-slack-channels.api.test.ts (16 tests against MySQL with Slack and the model stubbed) and the CLI tests; existing Slack assistant tests pass unchanged.
  • Not built, on purpose: running the agent's turn. Every run credential today belongs to a person, so a turn would act with the speaker's or owner's access rather than the agent's own.
  • Not run live: no real Slack workspace or model.

Someone who manages an agent can put it in a Slack channel by the channel's
id. From then on a mention of the bot in that channel belongs to the agent
instead of the speaker's own assistant. The speaker is let through only when
they can already use the agent under its sharing: the owner, a person it is
shared with, or a member of a team or organization it is shared with. Anyone
else, including a Slack user who is not linked to a member and a member of
another organization, gets one private line and nothing runs.

This is the routing and permission slice only. No agent turn runs from a
channel yet, because a turn today always runs under a human member's
credential. A speaker who is let through is told privately that agents do not
answer in channels yet, and the agent's activity log records the mention with
the channel id and the member, never the message.

Adding or removing a channel needs the agent's owner or a manager, the Manage
connections permission and a recent sign-in. A channel has one agent, and it is
tied to the organization's own Slack workspace. Archiving the agent or
disconnecting Slack removes its channels. No Slack scope is added and nothing
is read from the Slack directory.

The CLI gains `openwork agents slack list`, `add` and `remove`.

Behind the agentSlackChannels flag, off by default. With it off the routes
answer 404 and a stored channel is ignored.

Tested with 16 new API tests against real MySQL with Slack and the model
stubbed (flag off, who may bind, cross-organization and workspace conflicts,
each sharing case, no access, unlinked speaker, other organization, access
removed between two messages, paused agent, retried delivery, bot messages,
unbound channel, unbinding, cleanup), 5 new CLI tests, the existing Slack
assistant and standing chat tests, and pnpm check.
@vercel

vercel Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
openwork-app Ready Ready Preview Dec 1, 2026 3:18am UTC
openwork-den Ready Ready Preview Dec 1, 2026 3:18am UTC
openwork-landing Ready Ready Preview, v0 Dec 1, 2026 3:18am UTC

Request Review

This branch was successfully deployed

3 active deployments
Preview – openwork-app — 8fe25ae4 Deployed Dec 1, 2026 by vercel[bot]
Preview – openwork-landing — 8fe25ae4 Deployed Dec 1, 2026 by vercel[bot]
Preview – openwork-den — 8fe25ae4 Deployed Dec 1, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant