Skip to content

feat(channels): Slack shows every turn of a conversation - #2438

Draft
cjol wants to merge 1 commit into
mainfrom
channels/10-slack
Draft

cjol wants to merge 1 commit into
mainfrom
channels/10-slack

Conversation

@cjol

@cjol cjol commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

This PR makes Slack a conversation surface: a Slack thread that joins a conversation sees every turn, from any surface.

Why

  • After the cleanup, Slack only had ingress. A thread should show the agent's answers as they stream, ask for approvals with buttons, and say when a turn fails.
  • Turns started elsewhere are quoted above the answer, so a thread can follow a conversation that began in the browser.
  • ConversationSurfaces holds the per-surface lifecycle so Telegram can reuse it in the next PR.

Public API Surface

No new exports. slack() from agents/experimental/channels/slack now renders turns, approvals and failures on threads that joined a conversation, in addition to ingress.

Code Changes

  • surfaces.ts (internal) tracks joined surfaces and drives a renderer per turn.
  • slack/index.ts streams with chat.startStream, appendStream and stopStream, and posts and updates approval messages.
  • slack-surfaces.test.ts runs Slack against the scripted harness in the Channels test object, which gains a Slack Channel. Slack offers no conversation operations, so a thread stays bound to one conversation.
  • Minor changeset for agents.

@changeset-bot

changeset-bot Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 20be18a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
agents Minor
@cloudflare/agent-think Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@cjol
cjol added this pull request to stack #2440 October 1, 2026 13:56
@agent-think

agent-think Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

🔴 agents import sizes: 1 entry point over threshold

Entry point Exports Largest gzip change Size now
🔴 agents/experimental/channels/slack 1 resized +4.7 KiB (+203.71%) 7 KiB
Changed exports (1)
Import Gzip change Size now
🔴 agents/experimental/channels/slack#slack +4.7 KiB (+203.71%) 7 KiB
How this works

Each runtime export is bundled on its own, minified, and gzipped. Changes smaller than 100 B, or smaller than 1% and 1 KiB, are ignored. Growth over 10% or 5 KiB is marked 🔴. This report is informational and does not fail CI. The workflow artifact contains every measurement.

Compared 68bd6a44 → 20be18ac · workflow run · reported by agent-think[bot]

@cjol
cjol force-pushed the channels/10-slack branch 2 times, most recently from 5d7fb81 to a61205c Compare October 1, 2026 14:27
@cjol
cjol force-pushed the channels/10-slack branch 2 times, most recently from 7ce2515 to f9f1d6b Compare October 2, 2026 10:18
@cjol
cjol force-pushed the channels/10-slack branch from f9f1d6b to 191ea29 Compare October 2, 2026 11:08
@cjol
cjol removed this pull request from stack #2440 October 2, 2026 17:37
@cjol
cjol force-pushed the channels/10-slack branch from 191ea29 to a8b1e69 Compare October 2, 2026 17:37
@cjol
cjol changed the base branch from channels/09-pi-tui to channels/pi-agent October 2, 2026 17:38
@cjol
cjol added this pull request to stack #2460 October 2, 2026 17:39
@pkg-pr-new

pkg-pr-new Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

agents

npm i https://pkg.pr.new/agents@2438

@cloudflare/ai-chat

npm i https://pkg.pr.new/@cloudflare/ai-chat@2438

@cloudflare/codemode

npm i https://pkg.pr.new/@cloudflare/codemode@2438

hono-agents

npm i https://pkg.pr.new/hono-agents@2438

@cloudflare/shell

npm i https://pkg.pr.new/@cloudflare/shell@2438

@cloudflare/think

npm i https://pkg.pr.new/@cloudflare/think@2438

@cloudflare/voice

npm i https://pkg.pr.new/@cloudflare/voice@2438

@cloudflare/worker-bundler

npm i https://pkg.pr.new/@cloudflare/worker-bundler@2438

commit: 20be18a

@cjol
cjol force-pushed the channels/10-slack branch from a8b1e69 to 131980b Compare October 2, 2026 18:20
@cjol
cjol force-pushed the channels/10-slack branch from 131980b to 57e14d8 Compare October 2, 2026 18:53
Base automatically changed from channels/pi-agent to main October 2, 2026 19:20
@cjol
cjol force-pushed the channels/10-slack branch from 57e14d8 to 803b9e9 Compare October 2, 2026 19:20
This PR makes Slack a conversation surface: a Slack thread that joins a conversation sees every turn, from any surface.

## Why

- After the cleanup, Slack only had ingress. A thread should show the agent's answers as they stream, ask for approvals with buttons, and say when a turn fails.
- Turns started elsewhere are quoted above the answer, so a thread can follow a conversation that began in the browser.
- `ConversationSurfaces` holds the per-surface lifecycle so Telegram can reuse it in the next PR.

## Public API Surface

No new exports. `slack()` from `agents/experimental/channels/slack` now renders turns, approvals and failures on threads that joined a conversation, in addition to ingress.

## Code Changes

- `surfaces.ts` (internal) tracks joined surfaces and drives a renderer per turn.
- `slack/index.ts` streams with `chat.startStream`, `appendStream` and `stopStream`, and posts and updates approval messages.
- `slack-surfaces.test.ts` runs Slack against the scripted harness in the Channels test object, which gains a Slack Channel. Slack offers no conversation operations, so a thread stays bound to one conversation.
- Minor changeset for `agents`.
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