Channels with history.
Seed the questions, people and earlier replies your agent needs to see.
Test Slack bots and agents in seeded channels and threads, with state that changes as they act.
Seed the questions, people and earlier replies your agent needs to see.
A message written by the agent becomes part of the state for later calls.
Rerun the scene from the same data to compare a change to your agent.
The task is to answer the newest question in #support. An older question about CSV exports distracts the bot, and it replies there instead. Both versions successfully post a message.
A check on the final thread catches the mistake. Change one line in the bot, keep the starting data and checks, and run the same scene again.
See how the scene was rebuilt| Check | Original bot | Fixed bot |
|---|---|---|
| Posted a reply | 3 of 3 | 3 of 3 |
| Answered the newest thread | 0 of 3 | 3 of 3 |
Recorded results from the supplied deterministic bot, with no LLM involved. This example checks thread selection, not model reliability.
The bot and scene include the conversation, the bug and the checks. Use Node.js 24 and CLI 0.1.6 to reproduce the recorded result.
Read the full walkthroughSave both files in an empty directory. The correct-thread check should fail on the original bot.
npm install -g @ancha-labs/cli@0.1.6
ancha init --agent "node bot.mjs"
ancha scene validate scene.yaml
ancha run scene.yaml --local -n 3
ancha baseline save beforeIn bot.mjs, change messages.findLast( to messages.find(. Keep the scene and checks unchanged, then compare.
ancha run scene.yaml --local -n 3 --compare beforeLocal process mode does not block outbound network access. Use Ancha’s supplied Slack endpoint and test credentials.
Configure the Slack base URL and test credentials in your agent. Check its API calls against the supported subset before you run it.
@slack/bolt 5.1.0@slack/web-api 7.19.0Bot-token API subset; no general Slack workspace clone.
SLACK_API_URL SLACK_BOT_TOKEN SLACK_SIGNING_SECRET SLACK_APP_TOKEN
/api/apps.connections.openprepared or running socket-selected trials; app token only; one active socket, one-use 30s grant, 3s ACK timeout and one retry total including reconnect; 10s ping/30s pong deadline
/api/auth.testavailable during prepared-session SDK bootstrap; HTTP events require signed URL verification before the clock starts
/api/chat.deleteemits message_deleted; deleting thread parents still lacks Slack tombstones
/api/chat.getPermalink/api/chat.postMessageerror code unverified against real Slack; a user id as channel posts in the DM with that user; emits message events for bot-member channels and DMs (channel_type im); human actor mentions also emit app_mention; HTTP uses signed URL verification
/api/chat.updatetext/blocks updates emit message_changed; metadata and attachments are explicit gaps
/api/conversations.create/api/conversations.history/api/conversations.info/api/conversations.join/api/conversations.listtypes im lists the caller's direct messages; mpim is accepted and matches nothing: multi-person DMs are not modeled
/api/conversations.members/api/conversations.openone user (a DM, created on first use) or an existing DM channel; return_im and prevent_creation; multi-person DMs are a gap
/api/conversations.replies/api/reactions.addemits reaction_added for bot-member channels; scripted slack.react uses the same mutation
/api/reactions.get/api/reactions.removeemits reaction_removed for bot-member channels
/api/search.messagesuser tokens arrive in a later plan
/api/users.conversationstypes im lists the caller's direct messages; mpim is accepted and matches nothing: multi-person DMs are not modeled
/api/users.info/api/users.list/api/users.lookupByEmailA stateful Slack API mock keeps data between calls. If your agent posts a message, a later read can see that message. Ancha supplies a documented Slack Web API subset with seeded channels, users and threads, so tests can inspect what the agent changed.
Point the bot at Ancha’s Slack endpoint and use the supplied test credentials. Define the channel data in a scene, run the bot, and check the resulting messages. The downloadable example needs no real Slack workspace, Slack API key or model.
An SDK mock helps test your own handlers by replacing client methods. Ancha provides an API endpoint backed by shared state, so successive reads and writes can be tested together. You can use SDK mocks for focused unit tests and Ancha for the supported multi-call workflow.
The catalog records tests with @slack/bolt 5.1.0 and @slack/web-api 7.19.0. Configure the client to use the environment’s Slack base URL and credentials; the connection guide covers the settings. Compatibility is limited to the documented API operations, rather than every Slack feature or SDK version.
The current catalog lists 22 HTTP endpoints, including conversations.history, conversations.replies and chat.postMessage. The coverage list on this page is generated from that catalog, including operation-specific gaps. Ancha is not a full copy of Slack.
Use recorded reads and writes to write the scene’s starting state, then supply missing context such as channel membership. Keep replies that arrived later out of the initial data. You describe the reconstruction yourself; direct import from tracing tools is not available.
Slack’s developer sandboxes are provided by Slack. Ancha is an independent simulation of a documented API subset, designed for seeded, repeatable agent tests. Use a real Slack environment when you need to validate behavior outside that subset.
The simulated Slack service keeps messages inside the world. Your agent must use the supplied endpoint and test credentials. Local process mode does not block outbound network access; use the documented isolated execution modes when you need a network boundary.
Start with the example, or talk through your agent’s workflow.
Ancha is an independent simulation environment and is not affiliated with Slack.