Skip to main content

Drafts

What you change in an agent is kept as a draft as you type, shared by everyone in the workspace. Callers hear the published version until somebody presses Publish; Discard goes back to it. Published versions are kept in the agent’s Settings → Versions → History, where one can be brought back into the draft. If the published agent changed after the draft was started (somebody else, or the API), Publish says so first. The agent’s knowledge, its success rules and the switches of its calendar and CRM are not part of the draft: they are saved at once. Three things can run the draft:
  • Test, next to Publish: choose Draft or Published and talk to it.
  • A phone number: in the agent’s Phone tab, set a number to Draft and call it. Use a number only your team knows.
  • Your app: add environment=staging to the voice socket.
It needs a session of the workspace that owns the agent; anyone else gets the published one. With no draft, staging is the published agent. Your own model’s key is never in a draft: the published agent’s is used. Conversations on a draft carry "environment": "staging" in their metadata.

Tests

In the agent’s Tests tab, a simulated caller talks to the agent by text and each call is checked against what you expect. A test is:
  • The caller: who they are and what they want, in your words.
  • It passes when: up to 12 checks, each judged on its own with a reason.
  • Its call: whether they call or the agent does, the data it brings, and whether nobody picks up a transfer.
  • What tools answer, in that test only. Any other tool answers ok. Nothing is booked, sent or transferred.
  • Longest call: 2 to 30 turns, 12 unless you change it.
Write some for me writes tests from the agent. In Conversations, a call’s Make a test of this writes one that plays that call again, without the caller’s details, so a problem you fixed does not come back. Run one or all of them against the draft or the published agent. Past runs are kept, with each call. If the last run had failures, Publish says so first. A test checks what the agent says and does, with its instructions, workflow, models and tools; not how it sounds.

What it costs

A test is billed by its tokens: about $0.04 with the default model, more with a dearer one or long instructions. Next to **Run all** is what running them all is expected to cost, and next to each result what it did. A run has up to 40 tests, and one expected to cost more than $10 asks first. A test stops at $2, and a run that reaches what it may cost leaves the rest not played, and says so.

API

Tests can be written through the Agents API too. A test’s call.script is what the caller says first, word for word, one turn each.
Both need agents:write. Leave out test_ids to run them all. max_usd is the most the run may cost; a run expected to cost more answers 409 tests.run_limit and runs nothing. Results appear in the dashboard as each test ends, each with its cost_usd.