Overview
channelstack tests the apps and agents you build for Slack, GitHub, Linear, Notion, Resend, Gmail and Discord: a Slack bot, a GitHub App, a Linear or Notion integration, an agent people email, a Discord bot, a notification bot, or an AI agent. It runs those platforms as fakes on your machine, and OpenAI's API for your agent's model, so a test can play the people in a conversation and check what they would see.
import { expect, test } from "vitest";test("a mention gets exactly one reply, in the thread", async ({ slack }) => { const ana = await slack.createUser({ name: "Ana" }); const channel = await slack.createChannel({ participants: [ana, slack.app] }); const msg = await ana.say("@my-agent summarize yesterday's incidents", { channel }); await expect(msg.thread).toHaveReplyFrom("my-agent", { text: /incident/i }); await expect(msg.thread).toHaveRepliesFrom(slack.app, { count: 1 }); await expect(channel).not.toHaveChannelMessageFrom("my-agent");});import refrom channelstack import SlackFixturefrom pytest_channelstack import expectasync def test_a_mention_gets_exactly_one_reply_in_the_thread(slack: SlackFixture) -> None: ana = await slack.create_user(name="Ana") channel = await slack.create_channel(participants=[ana, slack.app]) msg = await ana.say("@my-agent summarize yesterday's incidents", channel=channel) await expect(msg.thread).to_have_reply_from("my-agent", text=re.compile("incident", re.I)) await expect(msg.thread).to_have_replies_from(slack.app, count=1) await expect(channel).not_to_have_channel_message_from("my-agent")let ana = slack.create_user().name("Ana").await?;let channel = slack .create_channel() .participants(vec![&ana as &dyn Handle, &slack.app()]) .await?;let msg = ana .say("@my-agent summarize yesterday's incidents") .channel(&channel) .await?;expect(&msg.thread()) .to_have_reply_from("my-agent") .text(Regex::new("(?i)incident")?) .await?;expect(&msg.thread()) .to_have_replies_from(&slack.app(), 1) .await?;expect(&channel) .not_to_have_channel_message_from("my-agent") .await?;The test never touches your app. Ana's message goes into a fake Slack workspace, which delivers the event to your app the way Slack would. Your app answers through the Slack SDK it already uses, pointed at the fake. The matchers then read the thread.
- The test acts as Ana: she mentions the app in a channel.
- The fake Slack delivers the event to your app, signed, the way Slack does.
- Your app answers through the Slack API it already uses, which now points at the fake.
- The matcher reads the thread as Ana would see it, and passes.
What you get#
- Fakes of seven platforms on localhost: Slack, GitHub, Linear, Notion, Resend, Google (Gmail) and Discord, with their real APIs, webhooks, signatures, ids and error codes. Your app runs unchanged; one environment variable per platform points it at the fake.
- A fake model for AI agents. OpenAI's API at
openai.localhost, scripted per test: text, streams, tool calls, errors and a slow first token, images, audio, files and OpenAI's built-in tools. Anything that takes an OpenAI base URL works, from theopenaiSDKs and the AI SDK to OpenRouter and Azure OpenAI. See OpenAI. - Tests that read like the conversation. Every action belongs to the person who takes it (
ana.say(…),ben.click("Approve", …),mo.comment(…)), and every check is about what a person would see. - Checks that wait for your app. Replies arrive when they arrive. Positive checks wait until they hold; negative and exact-count checks wait until the app has gone quiet. A test never sleeps.
- The failures that matter, on demand. Slack's 3-second retry, redelivered webhooks, bad signatures, rate limits and dropped sockets, so you can test what happens on a bad day.
- The same test against the real platforms. With sandbox credentials in the environment, a test acts on a real workspace and reads the result back. It runs on the fakes for every pull request and live at night.
- Vitest and pytest. channelstack plugs into the test framework you already use, with fixtures and matchers. There are SDKs for TypeScript, Python and Rust, an attach CLI and an MCP server for coding agents.
What it doesn't do#
- It doesn't run your app. You start the app as usual.
channelstack envprints the variables it needs. - It doesn't write your model's answers. The fake OpenAI says what each test scripted, and never judges an answer. An agent that doesn't use it keeps its framework's fake model (the AI SDK's
MockLanguageModelV4, LangChain'sFakeListChatModel, …) or a real one. The matchers check how the agent behaved, not the exact words. - It isn't a pixel copy of each product. The UI shows the conversations people have with your app as the same transcript the matchers read, next to every delivery and API call behind them.
Where to go next#
| If you want to | Read |
|---|---|
| Know why this exists, and how it differs from mocking the SDK | Why channelstack |
| Get a first test passing in ten minutes | Getting started |
| Understand the pieces | How it works |
| Connect your own app | Connecting your app |
| Script what your agent's model answers | OpenAI |
| Look something up | Slack API, Matchers, CLI |