Skip to content

Check before going live

When people correct what an agent did, those corrections are the best test of the next version of the playbook. A check reruns a version on your recent corrected runs and shows, side by side, what that version would do where the person had to step in.

A check is advice. Nothing is run against your data, and nothing stops you from deploying: you read the cases and decide.


What a check does

Each past run of the playbook in which a person corrected a step is a case. A run counts once, at its first corrected step. Chats do not count. The check:

  1. takes the cases, up to the number you set: runs in live first, then runs in dev, newest first in each;
  2. reruns the version on each one from what that run recorded, up to the first corrected step;
  3. stops there. The version proposes a tool call or an answer, but the call is never made;
  4. shows the proposal beside what the original did and what the correction said.

A check uses credits, because the agents think again. It stops at the corrected step, so it normally costs less than the runs it repeats. A check on an agent that runs on your own key is paid on that key.

A check is not a run. It does not appear in the run list, count toward probation, limits, auto-pause, reports or notifications, and it never changes a run. Checks and their results are kept for 30 days.


Settings

Two settings on the playbook, in Edit details:

Setting Meaning
Check new versions against past corrections before they go live Off by default. When on, a deploy to live first offers a check.
How many past corrections to check 1 to 50. Leave empty for 20.

Through the API, PATCH /playbooks/{uuid} takes check_before_live (true or false) and replay_cases (1 to 50, 0 for 20). Unlike the other fields of that call, these two keep their value when left out. A number outside 1 to 50 answers 400 workforce: invalid: replay cases must be 1-50.


Run a check

On a version, choose Test this version. A dialog titled Test version 0.2.0 shows the estimate first:

12 corrected runs, estimated 3.2-8.5 credits

The range is a guide, not a promise. For an agent on your own key it reads 12 corrected runs, paid on your own key. When no run has been corrected yet it reads There are no corrected runs yet. and there is nothing to start.

Choose Start. The dialog shows Waiting to start, then Checking, with the credits used so far, and ends Finished. A check that could not complete shows Failed. Choose Cancel the check to stop one that is waiting or running; a case already being rethought finishes first, and the check shows Cancelled. Only one check of a version runs at a time.

The dialog also lists Earlier checks of this version, so you can reopen a result.

With a deploy

With the setting on, Deploy to live opens the same dialog with the note Check version 0.2.0 first, then deploy it or cancel. Choose Check first to run it and then Deploy when it has ended, or Deploy without checking to skip it. The deploy itself is the same as ever.


Read the results

Each case is a card titled Corrected step 4 with:

Part Meaning
What the original did The step of the original run: the tool and its arguments, or the text.
What the correction said What the person said should have happened.
What this version proposes The tool call or the answer the new version gives at that point, or Nothing proposed.

And one outcome:

Outcome Meaning
Reached the step The version got to the corrected step and proposed something. Compare it with the correction.
Different path The version did something else earlier. The card says Took a different path at step 3, and shows what it did instead.
Failed The case could not be checked, for example because of an error or a limit.

Read every case: the check says what the version would do, not whether that is right.


From code

Route Perm Purpose
GET /playbooks/{uuid}/versions/{version}/replays/estimate R How many cases, and estimate_low, estimate_high in credits.
POST /playbooks/{uuid}/versions/{version}/replays M Start a check (202).
GET /playbooks/{uuid}/versions/{version}/replays R The version's checks, newest first.
GET /playbooks/{uuid}/versions/{version}/replays/{replay} R One check with its cases in case_results.
POST /playbooks/{uuid}/versions/{version}/replays/{replay}/cancel M Cancel a check.

A check has status (queued, running, done, failed, cancelled), cases, estimate_low, estimate_high and credits used. Each case in case_results has run_uuid, step_index, outcome (reached, diverged, failed), diverged_at, proposal (kind is call, answer or error), original, correction and comment.

Starting a check does not need the playbook's setting. Errors:

Status Message Meaning
400 workforce: no corrected steps to replay No corrected runs to use.
403 Workforce isn't on this project's plan. The plan does not include Workforce.
404 not found No such playbook, version or check.
409 workforce: this version is already being replayed One is already waiting or running.
409 workforce: the replay has already ended Cancel on a check that has ended.