Task 5.2
Escalation & Error Propagation
How subagent failures must surface to the coordinator
📘What You Need to Know
Why Error Propagation Matters in Multi-Agent Systems
In multi-agent architectures, subagents perform specialized tasks — database lookups, document searches, API calls. When a subagent fails, the coordinator must know exactly what happened to decide the next step: retry, use partial results, try an alternative agent, or escalate to a human.
Flat error strings like "something went wrong" give the coordinator nothing to act on. Structured error metadata — isError, errorCategory, isRetryable, context — enables intelligent recovery. This pattern appears on nearly every Domain 5 exam question involving multi-agent systems.
Access Failure vs Empty Result
This distinction is critical and heavily tested. Access failure means the subagent could not perform the search — database timeout, authentication error, network failure. The search was NOT performed. Report isError: true with error details.
Empty result means the search WAS performed successfully but found nothing — no matching orders, no documents, no records. Report isError: false with results: []. The coordinator can confidently tell the user "no orders found" rather than "I could not check."
# Access failure (search NOT performed)
{
"isError": true,
"errorCategory": "timeout",
"isRetryable": true,
"context": "Order database connection timed out after 30s",
"partialResults": []
}
# Empty result (search WAS performed, found nothing)
{
"isError": false,
"results": [],
"context": "Searched orders for ACC-12345, no matches in last 90 days"
}Never silently return empty results for access failures. The coordinator must know data is MISSING, not assume nothing was found.
What Subagents Must Report
Every subagent response — success or failure — must include enough metadata for the coordinator to act. On failure: what was attempted, what error occurred (with category and retryability), and any partial results gathered before failure. On success: results with provenance metadata.
Never silently drop failures. If a subagent cannot access the database, returning results: [] without isError: true is the worst possible response — the coordinator assumes the search succeeded and tells the user "no orders found" when the truth is "we could not check."
- •What was attempted: the query, parameters, and target system
- •Error category: timeout, auth, not_found, rate_limit, validation
- •Retryability: can retrying with modified parameters succeed?
- •Partial results: any data gathered before the failure occurred
- •Access failure (isError: true) vs empty result (isError: false)
Valid and Invalid Escalation Triggers
Valid escalation triggers: customer explicitly requests a human agent, policy gap detected (situation not covered by rules), task exceeds agent capabilities, business threshold exceeded (refund > $500 via hooks), and repeated failures after reasonable recovery attempts.
Invalid escalation triggers: negative customer sentiment (an angry customer with a simple resolvable request does NOT need a human), and self-reported model confidence (model confidence is not well-calibrated for decision-making). The exam tests sentiment vs complexity distinction frequently.
Sentiment ≠ complexity for escalation. An angry customer asking for order status does not need a human. A calm customer requesting a $5,000 refund with policy ambiguity does.
Local Recovery Before Escalation
Subagents should attempt local recovery before escalating to the coordinator. Retry with narrowed parameters after a timeout. Try an alternative data source after an auth failure. Reformulate the query after a validation error. Always report partial results even when local recovery fails.
Escalation to the coordinator (or human) is the last resort after reasonable recovery attempts — not the first response to any error. The coordinator receives the full error context plus partial results to make an informed decision.
⚠️Exam Traps
Trap: Subagent silently returning empty results on database access failure
Why it's wrong: Coordinator assumes search was performed and found nothing — tells user "no orders" when data is actually missing.
Trap: Escalating to human immediately on any subagent error without local recovery
Why it's wrong: Many errors are retryable — timeout, rate limit, broad query — and recoverable at subagent level.
Trap: Escalating to human because customer is angry, even for simple resolvable requests
Why it's wrong: Sentiment is not a valid escalation trigger — angry customers with simple requests can be handled by the agent.
Trap: Returning flat error strings like "Operation failed" from subagent tools
Why it's wrong: Coordinator cannot determine whether to retry, use partial results, or escalate without structured metadata.
✓Concept Check
A subagent cannot reach the order database due to a connection timeout. What must it report to the coordinator?
🔨Build Exercise
Intermediate40 minutesImplement Error Propagation in Multi-Agent System
What you'll learn
- •Define error reporting contracts between subagents and coordinator
- •Distinguish access failures from empty results
- •Implement local recovery before escalation