← Back to Labs

Error Propagation Context

context managementFill in Blank

Complete this structured error context object returned from a failed web search subagent. The coordinator needs enough information to make intelligent recovery decisions.

interface SubagentErrorContext {
  failureType: string;
  attemptedQuery: string;
  partialResults: SearchResult[];
  alternativeApproaches: string[];
}

function buildErrorContext(
  error: Error,
  query: string,
  resultsBeforeFailure: SearchResult[]
): SubagentErrorContext {
  return {
    // Classify the failure so the coordinator knows whether to retry
    failureType: "",

    attemptedQuery: query,

    // Include what was gathered before the failure occurred
    partialResults: ,

    // Suggest recovery strategies the coordinator can evaluate
    alternativeApproaches: [
      ,
    ],
  };
}