Launch price: every exam for $29.99 a year, for the first 300 buyers. See the price

CertStreak
Menu

Design tool error-handling and fallback mechanisms

A worked example

Single answer

Contoso Capital runs an investment research hub agent in Microsoft Foundry Agent Service. Four spoke agents are registered as function tools on the hub: market analysis, risk assessment, compliance checking and news sentiment. Orchestration code runs each spoke when the hub requests it and submits the tool outputs back to the hub.

During a provider outage, the news sentiment spoke times out on most calls. The design must meet these requirements:

  1. After the spoke has failed repeatedly, stop calling it for a cooldown period so the hub does not waste time and tokens on it.
  2. The hub must still return a research report built from the spokes that succeeded, and the report must tell the reader which analysis is missing or out of date.
  3. Retry, fallback and partial-result decisions must be made by a component that knows the state of the whole workflow.

Which design meets all the requirements?

Choose one answer
Why

The orchestration layer is the right place for retry, fallback and partial-result decisions, since only it can see the state of the whole workflow; spokes simply report whether they succeeded. A per-spoke circuit breaker that opens after three consecutive failures stops wasted calls to the broken news sentiment spoke during a cooldown. The circuit-open status lets the hub carry on with the spokes that succeeded and add caveats about the missing analysis, so the user gets a partial report instead of an outright failure.

  • Correct: In the orchestration code, open a per-spoke circuit after three consecutive failures and let the hub synthesize partial results with caveats. The orchestrator counts failures per spoke and stops invoking a spoke after three in a row for a cooldown, returning a circuit-open status. The hub then produces partial results with caveats. The orchestrator has the workflow-level context that spokes lack.
  • Not correct: In the orchestration code, open a per-spoke circuit after three consecutive failures and submit cached data without indicating fallback status or age. The source provides cached fallback data with a status indicator and age so the hub can adjust its synthesis. Omitting that information does not ensure that the report identifies the stale analysis, as required.
  • Not correct: In the orchestration code, retry each failed spoke call with exponential backoff and let the hub synthesize partial results with caveats. This keeps invoking the failing spoke on every request. A circuit breaker is what stops calls to a broken spoke for a cooldown period and prevents the wasted time and tokens.
  • Not correct: In the orchestration code, open a per-spoke circuit after three consecutive failures and fail the whole research request. Graceful degradation returns whatever partial output is available instead of failing outright. When the circuit is open, the hub should continue without the broken spoke's input, not abandon the workflow.
  • Not correct: In each spoke agent, open its own circuit after three consecutive failures and return partial results with caveats. The source places failure handling in the orchestrator rather than inside the spokes. A spoke cannot see the wider workflow, so it should just perform its task and report whether it succeeded, leaving retry, fallback and partial-result decisions to the orchestrator.

Practise this topic until it's automatic.

Ten questions a day, every answer explained, and misses that come back until you beat them.

Start free