Task statement 5.3 · Context management and reliability
Implement error propagation strategies across multi-agent systems
The research system is writing a report on grid-scale battery storage in six European markets. The coordinator sends four topics to the web search subagent: cost trends, manufacturers, deployments and national incentives. The incentives topic needs one query per market, and the queries for Italy and Poland time out. What the report says about those two markets depends on the subagent's reply.
share
The tempting fixes all look tidy. Returning empty lists for the timeouts keeps the run green, but the coordinator reads "searched, found nothing", so the report states that Italy has no incentives. Retrying and then returning "search unavailable" is honest, but it drops the failed queries and the four markets that worked, so the coordinator can only repeat everything blind or drop the topic. Stopping the run fails the other way, because one unreachable source then discards three finished topics.
KnowledgeWhat crosses the agent boundary
A subagent runs in its own context window, and only its final message returns to the coordinator. The coordinator never sees the timeouts, the retries or the pages read, so that message is its only evidence about what failed. Section 2.2 marked a single tool's failed result with isError: true and added a category and a retry flag, so that its caller can recover. A subagent's message must carry more, because the coordinator chooses between whole routes: the failure type, what was attempted, the partial results already obtained, and the alternatives the subagent knows of. A generic status such as "search unavailable" says only that something failed, so the coordinator cannot tell a two-market gap from a dead search engine.
- Four markets answer; the Italy and Poland queries time out.
- The subagent retries both itself, twice each, with backoff.
- Both still fail, so it propagates what it could not resolve.
- Its final message carries the failure type, the queries attempted, the four markets' results, and an alternative source.
- The coordinator reroutes the two markets, or proceeds and has the gap disclosed.
Interactive · four ways to report the same two timeouts
Shown: structured error context. Choose what the subagent returns, and follow it to the report.
Suppressed error. The coordinator was told all six searches succeeded, so it never retries, and the report states two falsehoods with confidence.
Generic status. The local retries were right; throwing away the failure type, the queries, the four markets and the alternatives was not.
Terminated on a single failure. Two unreachable markets cost everything that worked.
Structured error context. The coordinator reroutes the two markets, recovers Italy, and the report discloses the one market still missing.
KnowledgeWhich agent retries
Recovery splits by what the retry needs. The subagent retries when the identical call can succeed after a short wait, as with a transient timeout or rate limit, because the coordinator gains nothing from hearing about a blip and every report costs it context. The retries are bounded, here two per query, so a real outage still surfaces quickly. The coordinator owns the next attempt when recovery needs something the subagent lacks: another source or subagent, a narrower scope, or a decision to ship with a gap. A coordinator that re-sends the query the subagent already retried is repeating work, which is why the report must say what was attempted.
KnowledgeTwo replies that look alike and mean opposite things
Italy's query never completed, so nothing is known about Italian incentives, and the coordinator must decide whether to retry, reroute or disclose. Portugal's query ran and matched nothing, which is a finished, correct answer, so "no national programme found" goes in the report as a finding. If the subagent returns both as an empty list marked success, the coordinator treats Italy as a finding too, and that silent suppression makes every later agent repeat the false absence with confidence.
The source was never searched
{ "market": "IT",
"status": "error",
"failure_type": "timeout",
"attempted": "incentives IT, 2 retries" }Needs a decision: retry differently, reroute, or proceed and disclose.
The source was searched and had nothing
{ "market": "PT",
"status": "success",
"results": [] }Needs nothing: "no programme found" is a finding.
SkillFrom a false absence to a disclosed gap
The first draft says Italy and Poland offer no national storage incentives, and a reviewer knows both do. The web search subagent had caught the two timeouts and returned empty lists as success, so every later agent treated an access failure as a result. The fix keeps the four markets that worked and adds structured error context beside them.
// web search subagent → coordinator, after local retries
{ "status": "partial",
"results": { "DE": [ … ], "FR": [ … ], "ES": [ … ], "PT": [] },
"errors": [ { "failure_type": "timeout", "markets": ["IT", "PL"],
"attempted": "incentives query per market, 2 retries each",
"alternatives": ["national energy agency registries"] } ] }
The coordinator re-delegates Italy and Poland to the document analysis subagent with the registries as sources. Italy's registry answers and Poland's is offline, so the coordinator proceeds instead of terminating the workflow. The synthesis subagent adds coverage annotations: which findings are well supported and which topic areas have gaps because sources were unavailable.
## Coverage (synthesis subagent) Well supported cost trends (9 sources) · deployments (6 sources) Supported incentives, 5 of 6 markets (PT: no programme exists) Gap incentives, Poland: source unreachable after retries and a registry fallback; absent, not zero
| The same call should work after a short wait | The subagent retries, a bounded number of times, and says nothing if it clears. |
| It persists, or needs another source or scope | The subagent returns failure type, attempt, partial results and alternatives. The coordinator reroutes or narrows. |
| No route reaches the source | The coordinator proceeds, and the synthesis output annotates the gap. |
- A subagent's final message is the coordinator's only view of a failure, so a generic status leaves it guessing.
- "Timed out" and "searched, found nothing" are different results. Sending both as an empty success turns an outage into a false finding.
- One unreachable source should cost a disclosed gap in the report, never the whole workflow.