Skip to content

Chapter 10: Error Handling in Multi-agent Systems ​

10.1 Error Categories ​

CategoryExamplesRetryableAgent action
TransientTimeout, 503, network failureYesRetry with exponential backoff
ValidationInvalid input format, missing required fieldNo (fix input)Modify request and retry
BusinessPolicy violation, threshold exceededNoExplain to the user; propose an alternative
PermissionAccess deniedNoEscalate

10.2 Error-handling Anti-patterns ​

Anti-patternProblemCorrect approach
Generic status “search unavailable”The coordinator can’t decide how to recoverReturn error type, query, partial results, alternatives
Silent suppression (empty result = success)Coordinator thinks there were no matches, but it was a failureDistinguish “no results” from “search failure”
Aborting the whole workflow on one failureYou lose all partial resultsContinue with partial results; annotate gaps
Infinite retries inside a subagentLatency and wasted resourcesLocal recovery (1–2 retries), then propagate to coordinator

10.3 A Structured Subagent Error ​

json
{
  "status": "partial_failure",
  "failure_type": "timeout",
  "attempted_query": "AI impact on music industry 2024",
  "partial_results": [
    {"title": "AI Music Generation Report", "url": "...", "relevance": 0.8}
  ],
  "alternative_approaches": [
    "Try a narrower query: 'AI music composition tools'",
    "Use an alternative data source"
  ],
  "coverage_impact": "Not covered: AI impact on music production"
}

This provides the coordinator with the information needed to decide:

  • Retry with a modified query?
  • Use partial results?
  • Delegate to a different subagent?
  • Continue without this section and annotate the gap?

10.4 Coverage Annotations in the Final Synthesis ​

markdown
## Report: AI Impact on Creative Industries

### Visual Art (FULL COVERAGE)
[research results]

### Music (PARTIAL COVERAGE — search agent timeout)
[partial results]
⚠️ Note: coverage for this section is limited due to a timeout in the search agent.

### Literature (FULL COVERAGE)
[research results]