HappHapp Docs

Tests

Write test cases with acceptance criteria and let a review model check every change of the agent

Tests catch a bad answer before a customer sees it. You describe a conversation and what the agent must (and must not) do; Happ plays it in a hidden playground chat — same prompt, model, tools and knowledge base as live chats — and a review model judges the dialogue: Passed or Failed, a score from 0 to 1 and a verdict.

Open it from the agent sidebar: Monitor > Test. Tests run as text chats; to check the voice, use Test with a call in the top bar.

Add a test case

Add case opens the editor:

FieldWhat it does
NameUp to 300 characters, e.g. "Finds a product in the catalogue"
ModeAI client — a model plays the customer from your scenario (up to 12 turns). Script — up to 10 client messages sent word for word, in order
Client scenario / Client messagesWho the customer is, what they want, the data they give — or the exact messages
Acceptance criteriaWhat the agent must do and must not, e.g. "Calls search_in_vector() before quoting a price"
Dynamic variablesValues for {{placeholders}} in the prompt during this test — as on a real call
Tool mocksFake responses for tools (see below)
Spend limitsMax messages in dialog (2–200) and Max cost, $. Exceeding a limit stops the case with an error

New cases are saved switched off: turn on Run with all in the table to include them in Run all.

Suggest (AI) drafts cases for you: the model reads the agent's prompt, tools and knowledge base. Add an optional focus ("refunds, rude clients"), pick how many (1–10), keep the ones worth keeping.

Mock the tools

Tool calls in tests are real unless mocked — a test can create a real order in your CRM. Mock anything that changes data:

  • Mock all tools — every tool call in every test of this agent gets a mock response.
  • This test / All tests — mock one tool for one case or for the whole agent. Rules are checked top to bottom, the first match wins; a rule can match on a call argument (parameter = value) and can return an error.

Run

  • Run all runs every switched-on case; ▶ on a row runs one case, even a switched-off one.
  • Run on picks the main version or a draft — test an experiment before it goes live.
  • Review model — the judge's model. Default is the agent's; a different, stronger one is a better judge.

Before every run Happ shows an estimate: cases, models, tokens and estimated cost. Cases run three at a time.

Read the results

Runs lists every run with its status (Queued, Running, Completed, Failed), passed / total, tokens, cost and duration. Open a run to see:

  • regressed and fixed cases compared with the previous run;
  • each case: score, the judge's verdict, the full dialogue with every tool call and its input and output;
  • Suggest a fix — a minimal edit to the prompt that would make the case pass. It's a suggestion: apply it yourself, then run the case again.

A case gets Error instead of Failed when it couldn't finish: a limit was hit, a tool broke, or the judge answered nonsense.

API: api.happ.tools/reference

Next

Help me solve it

Happ answers right away and hands over to a manager when needed.

On this page