Standard checks
The standard checks are a set of tests for the bugs apps and agents commonly have on each platform: answering twice, answering in the wrong place, answering themselves, mishandling a retry. This page shows how to add them to your suite, what each check catches, and how to leave one out.
Add the checks#
import {
discordChecks,
githubChecks,
googleChecks,
linearChecks,
notionChecks,
resendChecks,
slackChecks,
} from "channelstack/checks";
slackChecks({
app: "my-agent",
streamPrompt: "write a long report on Q3",
approval: { prompt: "@my-agent deploy web to staging", button: "Approve" },
});
githubChecks({ app: "my-agent" });
linearChecks({ app: "my-agent" });
notionChecks({ app: "my-agent", prompt: "@my-agent summarize this page" });
resendChecks({ app: "my-agent", prompt: "Where is my refund?" });
googleChecks({ app: "my-agent", prompt: "Where is my refund?" });
discordChecks({ app: "my-agent", command: "/deploy web", longPrompt: "write a long report on Q3" });
Each call registers ordinary Vitest tests in the file it's called from, on the fixtures and matchers of channelstack/vitest, so the plugin must be set up. The tests are grouped in a describe named after the platform and the app (slack checks: my-agent), and each test name ends in the check's id:
✓ slack checks: my-agent > replies once to a DM [slack.dm-once]
✓ slack checks: my-agent > survives Slack's retry after 3 seconds [slack.retry]
✓ github checks: my-agent > every check run it starts reaches a conclusion [github.check-run]
A check you skip, or one whose option you didn't give, isn't registered at all, so it doesn't show up in the report.
Call only the functions for the platforms your app is on. The checks are written against the public test API, the same one your own tests use, so a failing check reads like one of your tests failing: the matcher's message says what a person would have seen.
Options#
| Option | Default | What it's for |
|---|---|---|
app | required | The app's name as people mention it: my-agent, or any app's. For another name the checks make that app (createApp({ name })) and run against the agent driving it, so slackChecks({ app: "coder" }) checks a second agent (several apps) |
prompt | @<app> hello | Text that makes the app answer. For Linear it's the title of the issue that gets delegated, default Look into this |
streamPrompt | none | Text that makes the app stream a longer answer in a DM. Without it, the two stream checks are left out |
approval | none | { prompt, button }: text that makes the app ask for an approval, and the label of the button it shows. Only a workspace admin may press it. Without it, the two click checks are left out |
command | none | Discord: a slash command the app answers, as a person types it (/deploy web). Without it, the two interaction checks are left out |
longPrompt | none | Discord: text that makes the app answer with more than one message may hold (2000 characters). Without it, the long-answer check is left out |
model | none | "openai": the app's model is the fake OpenAI. Every check that scripts nothing itself answers each model call with a plain answer, the stream and Stop checks script a long stream and need no streamPrompt, and the Slack model checks are added (below) |
skip | [] | Check ids to leave out, for example ["slack.stream-stop"]. An id that no check has throws, with the list of ids |
timeout | the plugin's timeout | How long each check waits for the app |
loopTurns | 3 | How many times the app may answer another app that answers everything, with no person between them, before <platform>.no-reply-loop fails. An app built to hand off to another sets it higher, or skips the check |
Pick prompts your app answers quickly and in a single message. With a real model, a short, plain prompt keeps the checks fast. With a framework's fake model, use one your script already handles. On the fake OpenAI, pass model: "openai" and the checks script the model themselves.
Slack checks#
| Id | What the test does | What it catches |
|---|---|---|
slack.dm-once | Ana DMs the prompt; expects exactly one reply | Two answers to one DM |
slack.mention-once | Ana mentions the app in a channel; expects exactly one reply | Answering both the app_mention and the message event for the same message |
slack.in-thread | A mention in a channel; expects a reply in the thread, and no message in the channel itself | Answers that land in the channel instead of the thread |
slack.retry | Retries the mention's event after 3 seconds, as Slack does; expects one reply | Answering again on Slack's retry |
slack.redelivery | After the reply, sends the same event again, unchanged; expects one reply | An app that only checks the retry headers, not the event_id |
slack.ignores-bots | Another bot mentions the app; expects no reply | Bot-to-bot loops |
slack.bad-signature | Resends a DM's event with a wrong signature; expects a 4xx | Turned-off or broken signature checks. Over Socket Mode there's no signature, and the check passes without sending anything |
slack.ack | A DM; expects the delivery acknowledged within 3 seconds | Work done before the acknowledgement |
slack.msg-too-long | Slack refuses the app's next chat.postMessage once with msg_too_long; expects exactly one reply in the end | An app that gives up, or crashes, when a message is too long |
slack.stream-stop | Needs streamPrompt. Expects a streaming reply that ends completed, and the thread idle | A stream that is never stopped, leaving "Thinking…" up |
slack.stop | Needs streamPrompt. Ana presses Stop during the stream; expects the thread stopped and exactly one reply | Writing on after Stop |
slack.click-unauthorized | Needs approval. A non-admin presses the button; expects the thread to still hold only the ask | Acting on, or answering publicly, a click from someone who may not act |
slack.double-click | Needs approval. An admin presses the button twice at once; expects exactly one new message in the thread | Acting twice on a double click |
slack.no-reply-loop | Another app in the channel answers every reply of the app's, mentioning it; expects the thread to go quiet, the app answering it at most loopTurns times | Two agents answering each other without end. Ignoring bot messages only by subtype: "bot_message" misses a modern app's, which carry bot_id and no subtype |
slack.double-click counts messages: the app should answer one approval with exactly one new message in the thread. Replacing the question as well is fine, and so is removing the button once it has acted. An app that answers only by editing the question, or with several messages, should skip this check.
slack.msg-too-long injects a fault, which applies to the whole workspace while it lasts. Run the Slack checks where no other test posts at the same moment, or skip that check in a parallel suite.
On the fake OpenAI#
With model: "openai", slackChecks adds one check for each bug a model's timing and failures cause. Each scripts the model itself:
slackChecks({ app: "my-agent", model: "openai" });
| Id | What the test does | What it catches |
|---|---|---|
slack.slow-model | The model's first token takes 5 seconds, and Slack retries the DM's event after 3; expects exactly one reply | A slow model that makes the app answer Slack's retry too |
slack.model-error | Every model call fails with overloaded; expects a reply, no stream left open, and the thread idle | An app that says nothing, or leaves "Thinking…" up, when the model fails |
slack.model-retry | The first two calls fail with overloaded, the third answers; expects that answer, once | A retried model call that posts twice, or not at all |
slack.stream-breaks | The model's stream is cut after three chunks; expects a reply, no stream left open, and the thread idle | A stream that breaks halfway and is never stopped |
slack.stop-cancels-model | The model's stream is held after three chunks and Ana presses Stop; expects the thread stopped and the model call aborted | An app that stops posting but leaves the model running |
slack.no-secrets-to-model | A DM; expects no token, signing secret or key in anything the app sent the model | A token, signing secret or key in the prompt |
The ids are exported as SLACK_MODEL_CHECKS. Only Slack has model checks so far; the other platforms' are #120. With model: "openai", their checks still answer each model call, so an agent on the fake OpenAI passes them.
GitHub checks#
Each check works in a fresh repository with the App installed and Ana as a collaborator.
| Id | What the test does | What it catches |
|---|---|---|
github.ignores-own-comments | Ana mentions the app in an issue; expects exactly one comment from it | An app that answers its own comment, again and again |
github.one-comment | Ana mentions it twice, waiting for each answer; expects exactly two comments | More than one comment per trigger |
github.review-thread | Ana mentions the app in a comment on a pull request's diff; expects one reply, from the app, in that thread | Answers that go to the pull request's conversation instead of the review thread, or nowhere |
github.redelivery | Redelivers the comment's webhook with the same GUID; expects one comment | Handling a redelivery from the App's settings as a new event |
github.check-run | Opens a pull request; once the app is quiet, expects every check run to be completed | Check runs left queued or in_progress, which block merging |
github.bad-signature | Resends the webhook with a wrong signature; expects a 4xx | Turned-off webhook verification |
github.no-reply-loop | Another App on the repository mentions the app after each of its comments; expects at most loopTurns answers to it | An App that answers every issue_comment, a bot's included: GitHub sends an App the other Apps' comments, and nothing stops the loop |
github.check-run passes for an app that creates no check runs. Skip it if your App doesn't use them, to keep the report honest.
Linear checks#
Each check creates an issue titled with prompt and delegates it to the app, which opens an agent session.
| Id | What the test does | What it catches |
|---|---|---|
linear.first-activity | Expects some activity from the app within 10 seconds | A slow first response; Linear shows the session as unresponsive after that |
linear.ends-turn | Expects the session to reach complete, awaitingInput or error | A session left active after the work is done |
linear.stop | After the first activity, Ana presses Stop; expects complete or error | Ignoring the stop signal |
linear.redelivery | After the turn ends, redelivers the webhook that opened the session; expects at most one response activity | Starting the work over on a redelivery |
linear.stale | Resends that webhook with a webhookTimestamp two minutes old; expects a 4xx | Missing replay protection: Linear's receivers should refuse webhooks more than a minute old |
linear.bad-signature | Resends it with a wrong signature; expects a 4xx | Turned-off webhook verification |
linear.no-reply-loop | After the turn ends, another app comments on the issue after each of the app's comments; expects at most loopTurns answers | An app that answers every Comment webhook, another app's included |
Notion checks#
Each check has Ana post prompt as a comment on a page connected to the integration.
| Id | What the test does | What it catches |
|---|---|---|
notion.reply-in-discussion | Expects a reply in Ana's discussion, and no other discussion on the page | Answers posted as a new page comment, which the person doesn't see where they asked |
notion.ignores-own-comments | Expects exactly one comment from the integration | An integration that answers its own comment |
notion.redelivery | Sends the comment's webhook again; expects one comment | Handling Notion's retry as a new comment |
notion.bad-signature | Resends the webhook with a wrong signature; expects a 4xx | Turned-off X-Notion-Signature checks |
notion.no-reply-loop | Another integration on the page replies in the discussion after each of the integration's comments; expects at most loopTurns answers | An integration that answers every comment.created, another integration's included |
Resend checks#
Each check has Ana email prompt (default hello) to the agent's address.
| Id | What the test does | What it catches |
|---|---|---|
resend.reply-in-thread | Expects the answer in Ana's mailbox, in the thread her email started | An answer without In-Reply-To and References, which starts a new thread |
resend.redelivery | Sends the email.received webhook again, as Resend retries; expects one answer | Handling Resend's retry (the same svix-id) as a new email |
resend.bad-signature | Resends the webhook with a wrong signature; expects a 4xx | Turned-off resend.webhooks.verify |
resend.stale | Resends it signed more than five minutes ago; expects a 4xx | Missing replay protection on svix-timestamp |
resend.no-reply-loop | Another app emails the agent, marked Auto-Submitted: auto-replied, and answers each answer the same way; expects at most loopTurns answers | An agent that answers mail a program sent on its own: the oldest email loop. Mark answers with Auto-Submitted (RFC 3834) and leave mail so marked unanswered |
Google checks#
Each check has Ana email prompt (default hello) to the agent's Gmail address. The agent must be watching its inbox (users.watch) for a push to reach it.
| Id | What the test does | What it catches |
|---|---|---|
google.reply-in-thread | Expects the answer in Ana's mailbox, in the thread her email started | An answer without In-Reply-To and References, which starts a new thread |
google.history | Ana sends two emails at once, which one push tells of; expects one answer to each | An agent that answers only the newest message instead of listing its history |
google.redelivery | Pushes the same Pub/Sub message again, as Pub/Sub delivers at least once; expects one answer | An agent that reads history from the start again, or answers a message twice |
google.bad-signature | Pushes it again with a token another key signed; expects a 4xx | Turned-off verifyIdToken |
google.wrong-audience | Pushes it again with a token for another endpoint; expects a 4xx | verifyIdToken without an audience |
google.stale | Pushes it again with a token that has expired; expects a 4xx | A signature check that skips the token's exp |
google.no-reply-loop | As resend.no-reply-loop, to the agent's Gmail address | Answering mail marked Auto-Submitted |
Discord checks#
Each check has Ana mention the app with prompt in a channel with the bot, or DM it, as the check says. With app: "coder", the checks run against the bot of the app coder, and command is that app's command.
| Id | What the test does | What it catches |
|---|---|---|
discord.mention-once | Ana mentions the app in a channel; expects exactly one reply | Answering both a mention and the message it is in, or answering twice |
discord.dm-once | Ana DMs the prompt; expects exactly one reply | Two answers to one DM |
discord.ignores-bots | Another bot writes the prompt; expects no reply | A bot that answers bots (author.bot), and the loops that follow |
discord.no-reply-loop | Another app in the channel replies to each of the app's answers, mentioning it; expects at most loopTurns answers to it | Two bots answering each other without end: Discord sends a bot the other bots' messages, mentions included, with author.bot |
discord.resume | Drops the Gateway connection just before Ana's DM; expects one reply once the bot resumes | A bot that identifies anew instead of resuming, and loses or repeats what it missed |
discord.long-answer | Ana sends longPrompt; expects the answer split over several messages, and no 50035 refusal | An answer over 2000 characters, which Discord refuses, or one cut short |
discord.interaction-3s | Ana runs command; expects the answer within 3 seconds, and no "This interaction failed" | An interaction answered late, after Discord has given up on it |
discord.bad-signature | Over HTTP, sends the interaction again signed with another key; expects a 401 | An interactions endpoint that doesn't check X-Signature-Ed25519 |
Skipping a check#
List the ids in skip:
slackChecks({ app: "my-agent", skip: ["slack.msg-too-long"] });
githubChecks({ app: "my-agent", skip: ["github.check-run"] });
A check that needs an option you didn't give (streamPrompt, approval) is left out on its own, as if it were in skip. Leave a check out only when it doesn't apply to your app; when a check fails for a real bug, fix the app.
To run a single check while you work on its bug, filter by its id, which is part of the test name:
npx vitest run test/checks.test.ts -t "slack.retry"
The id lists are exported too, as SLACK_CHECKS, SLACK_MODEL_CHECKS, GITHUB_CHECKS, LINEAR_CHECKS, NOTION_CHECKS, RESEND_CHECKS, GOOGLE_CHECKS and DISCORD_CHECKS, for a script that builds skip from them.
In live mode#
Most checks are about delivery: retries, redeliveries, forged signatures, acknowledgement times. Live, the real platform delivers to your app, so a message or comment has no delivery to retry or forge. Every check that needs one skips, before it waits for anything, with the reason in the report (live: Slack delivers to the agent itself, so delivery checks are fake-only). Nothing needs to go in skip for a live run. A fake run whose agent has no webhook URL (CHANNELSTACK_<CHANNEL>_WEBHOOK_URL) has no deliveries either, so these checks skip there too, with the same note. That run is still red: every check that waits for a reply fails.
| Checks | Live |
|---|---|
slack.retry, slack.redelivery, slack.bad-signature, slack.ack, slack.slow-model; github.redelivery, github.bad-signature; linear.redelivery, linear.stale, linear.bad-signature; notion.redelivery, notion.bad-signature; resend.redelivery, resend.bad-signature, resend.stale; google.redelivery, google.bad-signature, google.wrong-audience, google.stale | Skip, with the delivery reason |
google.history | Skips at its exact count, because waiting for quiet needs proxy mode live (Live mode) |
slack.msg-too-long, slack.stop and the others that use a fault, Stop or an exact count | Skip, with the reason |
slack.in-thread, slack.ignores-bots, slack.stream-stop | Skip, with the reason: they wait for quiet, read the status line or create a bot user, which live mode can't do yet |
github.review-thread, github.check-run | Skip, with the reason: they open a pull request, and pull requests aren't built live yet |
<platform>.no-reply-loop | Skip, with the reason: they make a second app, or wait for quiet, which live mode can't do yet |
discord.dm-once, discord.resume, discord.long-answer, discord.ignores-bots, discord.interaction-3s, discord.bad-signature | Skip, with the reason: live, a person is a bot of their own, and Discord lets no bot DM another bot or run another app's command; another bot to ignore isn't built live; and the dropped connection is a fault |
Six run against the real platform: linear.first-activity, linear.ends-turn, notion.reply-in-discussion, resend.reply-in-thread, google.reply-in-thread and discord.mention-once. The fake run on every pull request runs them all.