Teaflask Docs

Agents

Tests

Tests replay real conversations against a new version of your agent, so you see what a change fixes or breaks before your users do.

Each test starts from a conversation one of your users had with a website agent: an AI writes the test, a simulated user plays that user again, and checks decide whether the agent did what it should. Open Tests in the sidebar to see each agent's tests and test runs.

How a test works

When you add a conversation, an AI reads it and writes the test:

  • Simulated user: who the user is, what they want, what they knew before, what they asked for, how they answer questions and how they write.
  • World facts: what was true before the conversation began, such as an account's plan or an order's status, read from what your tools returned.
  • Memory: what the agent remembered about this user at the time.
  • Checks: what the agent must do. A check about a change, such as "cancels the subscription once", is usually checked against the agent's tool calls. Every other check, including any you add or reword, is judged by AI.
  • Original outcome: whether the agent succeeded or failed in the real conversation, and why.

In a test run, calls to your API, your app and your MCP servers never leave Teaflask: a simulation answers them from the test's world facts. Memory in a test is a throwaway copy, so your real memory never changes, and test conversations don't appear under Conversations.

Add a test

  1. Open a conversation under Conversations once its last reply has finished.
  2. Choose Add to tests.
  3. Optionally, fill in What matters here, for example "It must ask before cancelling a plan". The test's checks follow your note.
  4. Choose Add to tests.

The test appears as Writing. Then the version of your agent that had the conversation replays it three times. If it gets the original outcome every time, the test is Ready. If it doesn't, the AI repairs the test once and checks it again.

Only a website conversation an agent had with one of its users can become a test, so Slack, Playground and Brew conversations can't. One agent must have served the whole conversation, and that agent must still exist. The AI also declines a conversation it can't replay fairly, for example because the user had no goal or left partway to finish elsewhere; the test then shows Can't be tested with the reason.

Test statuses

Status What it means
Writing The AI is reading the conversation.
Checking The original agent is replaying it.
Ready It reproduced the original outcome. Ready tests run in test runs.
Repairing The AI is fixing what didn't match.
Not checked The check couldn't run, for example because it couldn't be paid for or the spending cap was reached. Choose Check again.
Broken The original agent still didn't reproduce the original outcome after one repair. A test you edited isn't repaired. Fix a fact, a check or the original outcome and save, or choose Check again.
Can't be tested The conversation can't be a fair test.
Couldn't write Writing failed. Try again appears when another attempt can help.

Edit a test

Open the test and choose Edit to change any part of it or your note. Rewording a check that's checked against tool calls turns it into a check judged by AI.

Changing only the title or your note just saves. Any other change saves a new version, which the original agent checks again. Versions lists every version and who wrote it.

Run tests

  1. Open Tests and choose the agent.
  2. Choose Start test run.
  3. Pick the Version to test. It can be any saved version, including one you haven't published.
  4. Pick what to Compare with: usually the published version, or Nothing to test one version on its own.
  5. Check the estimate, such as "About $1.20 (up to $3.00)", then choose Start test run.

A test run's simulated tools, simulated user and judge run on the models chosen in Settings → Models, which also shows what pays for them.

Every ready test runs three times on each version, and passes only when all three tries pass, so behaviour that works only some of the time shows up as a failure. Up to ten tries run at once across your organization. The run carries on if you leave the page. To end it early, choose Stop test run: finished tries keep their results, and the rest won't start.

Read the results

A test run's page opens with a verdict, such as "No regressions.", then compares Tests passed, Agent cost / try and Agent time / try for the two versions. Tests lists every test with the ones to look at first on top: Regressed (passed before, fails now), Failed on both, Didn't finish and Fixed (failed before, passes now). Open a try to read its conversation and each check's result.

An AI judge decides the checks that aren't checked against tool calls. It runs on the model chosen for Test runs: judge in Settings → Models, even when your agent answers with the same model. If you disagree with a result, choose Override under a failed check, or the check's mark on a try, then give a reason and choose Mark as passed (or Mark as failed). Everyone sees who changed it and why.

Set the monthly spending cap

Tests have a monthly spending cap: $100 until an owner changes it. Owners set it on the Tests page under Spending cap → Spend up to, from $1 to $100,000. When the month's test spending reaches the cap, test runs and test writing stop until the next calendar month (UTC), or until an owner raises the cap. Writing one test stops at $5 and needs at least $5 of the cap left, and a test run stops at whatever is left.

Who can use Tests

Owners and members can see tests, add, edit and delete them, start and stop test runs, and override a check. Only owners see and change the spending cap.

Delete a test

Open the test and choose Delete this test, then confirm. Deleting is permanent; past test runs keep its results, listed as a deleted test. Deleting a user's memory under Memory also removes it from the tests made from their conversations.