Escalate or Not
Why This Matters
An assistant that escalates everything is just a noisier pipeline. One that never escalates is a risk. Good escalation rules are specific, testable and owned by the team, not left to the model’s mood.
When to escalate
| Situation | Why a human |
|---|---|
| A suspected product bug on a release branch | The cost of a wrong call is high |
| Agents disagree and the actions differ | The evidence needs judgement (lesson 39) |
| A write action with weak evidence | The world changes on a guess |
| A failure nobody can explain (unknown, repeated) | A human may know context TestPilot does not |
| A gate keeps blocking the same action | Something is wrong with the process or the data |
When not to escalate
| Situation | What TestPilot does instead |
|---|---|
| A known flaky test within its usual failure rate | Reports it, no alert |
| An environment outage that is already reported | Groups the failures under the existing incident |
| A duplicate of an open ticket | Adds a comment to the ticket |
| A clear test bug (changed label, broken selector) | Proposes a fix in the report |
Every unnecessary escalation teaches the team to ignore the next one.
Escalation as data
An escalation is not “please look at this”. It is a structured request:
{
"testId": "t-002",
"reason": "suspected_product_bug_on_release_branch",
"evidence": [ "API returned discount 0 for code WELCOME10", "commit 8f3c2a1 changed PricingService" ],
"decision": "Confirm the regression and decide whether to block release 4.2",
"options": ["block release", "ship with known issue", "not a bug"]
}
The human sees the evidence and the decision in one place, and their answer can flow back into the golden set.
Low confidence is a signal, not a rule
“Escalate when confidence < 0.7” sounds sensible but works poorly on its own. Models are not perfectly calibrated, and a confident wrong verdict on a release branch is exactly the case you want a human for. Combine signals: the situation (release branch, write action), the evidence (conflict, missing log) and only then confidence.
Test the rules
Run the escalation rules over the golden set and over a week of real runs:
- How many escalations per night would they cause? More than a handful and people stop reading.
- Which golden cases with a dangerous mistake would they have caught?
Tune until both numbers are acceptable to the team.
The rules in a real run
solution/lesson-60-reliability has these rules as code (shouldEscalate in src/team/escalation.ts). On run-1099, 40 failures in seven groups, they escalated exactly one thing:
Look at what did not reach a human: 27 failures from two infrastructure outages, a test bug with a renamed selector, a flaky test within its history, and a one-off unknown without any history. Each is in the report; none of them is an alert. The one escalation is the case the team decided needs a person: a confirmed product bug on main.
It took two real runs to get there. The first escalated the same discount bug twice, once per group, because code split the failures by symptom. Now a group that shares a bug proposal joins that escalation. The second run then reported “42 triaged” out of 40 failures: joining an escalation had changed the group’s own list. A test now checks that the report always adds up. Escalation rules are code; they get bugs, and tests, like any other code.
Exercise
Write TestPilot’s escalation rules as code (shouldEscalate(finding, context)), with the structured escalation output, and run them over the golden set. Report the number of escalations and the dangerous cases caught.
Compare with solution/lesson-60-reliability, which covers lessons 54–60 (see docs/exercises.md, module 7).
