Agentic control
Error repair
Use when the agent got something wrong and has to own it, show the fix, and give people a way to take it further.
The structured mistake: acknowledge, show the fix, offer recourse.
Part of Agentic control. The stage where the agent stops answering and starts doing. It covers the whole handover: agreeing what the agent may do, watching it work, stepping in, and checking what changed afterwards. Reach for these as soon as an action touches a customer, money or a record.
Do
- Admit the mistake in one plain sentence that says what happened.
- List what the agent has already done to correct it.
- Offer a way to inspect the fix and a way to reach a person.
Don't
- Don't use red banners, warning icons or alarm language. Stay calm and specific.
- Don't blame the user, the data or the rule.
- Don't hide the mistake in the log. Surface it where the person will see it.
States
- Acknowledged: The headline and one sentence on what went wrong.
- Corrected: A list of fixes, each drawn in with a tick.
- Recourse: Two actions, review the fix or flag it for a person, with a quiet note that it was logged to audit.
- Fix reviewed: A before and after line opens under the actions, showing the rule that changed.
Usage
import { ErrorRepairPattern } from "./halaska-kit";
<ErrorRepairPattern
headline="Alpha got this one wrong"
acknowledgment="Alpha archived the Stripe payout notice as a newsletter."
fixes={[
"Restored the notice to your inbox, unread",
"Added Stripe to the never-archive sender list",
]}
diff={{ label: "billing@stripe.com", before: "Newsletter", after: "Never archive" }}
onFlag={() => escalateTo("Dana Ruiz")}
/>
ErrorRepairPattern props
headlinestring(default "Alpha got this one wrong"): Plain-language admission (default: "Alpha got this one wrong")acknowledgmentstring(default "Alpha archived the Stripe payout notice as a newsletter. It matched the sender rule and never reached your inbox."): One sentence on what went wrong, no blame (default: the archived-payout-notice line)fixesTitlestring(default "What Alpha did about it"): Eyebrow above the fix list (default: "What Alpha did about it")fixesstring[](default REPAIR_FIXES): Corrective actions taken, each drawn in with a check (default: REPAIR_FIXES)diff{ label: string, before: string, after: string(default REPAIR_DIFF): | null} Before/after line revealed by Review; null hides the Review button and the diff (default: REPAIR_DIFF)reviewLabelstring(default "Review the fix"): Toggle-diff button label (default: "Review the fix")flagLabelstring(default "Flag for a human"): Escalation button label (default: "Flag for a human")footerstring(default "Logged to audit · nothing else was affected."): Quiet audit note under the actions; empty string hides it (default: "Logged to audit · nothing else was affected.")beatMsnumber(default 1200): Delay between the three beats when autoplaying (default: 1200)autoplayboolean(default true): Reveal beats on a timer; false shows all three at once, no timers (default: true)onReview() => void: Fires when the user toggles the diff open or closedonFlag() => void: Fires when the user asks for a human
Built from
Agent Glyph, Button, Card, Separator, Stack, Toggle, Typography
Related patterns
Halaska UI · Components · Patterns · Screens · Install