An agent's tool call fails with an error. The agent must decide how to respond. Which classification framework MOST correctly guides the agent's error-handling decision?
Select an answer to reveal the explanation.
Short Explanation
You classify the tool-call failure before you react. A network timeout is transient, so you wait and retry; a 403 Forbidden is not transient, so more retries won't make your token valid; a malformed request will fail every time, so retrying is waste. Error classification drives the response, not a uniform retry-or-abort policy.
Full Explanation
Effective error handling in agent tool calls requires classifying errors by their nature before deciding on a response. A one-size-fits-all retry policy leads to wasted calls to external services, unnecessary delays, and missed escalation signals.
The retry-all-failures-up-to-three-times approach assumes most errors are transient and treats all errors as transient. It causes the agent to retry invalid-input errors, which will always fail, retry authorization errors, which will always fail and may trigger account lockout, and retry service-unavailable errors that warrant escalation rather than indefinite retry. Blanket retry is correct for a small class of errors but harmful for others.
The classify-failures-by-type approach is the right guide: transient errors such as network timeout, connection reset, and 429 rate limit are recoverable with time, so retry with exponential backoff and jitter because they indicate a temporary condition, not a problem with the request. Invalid-input errors such as 400 bad request, parameter validation failure, and malformed payload will produce the same failure on every retry because the problem is with the request, not the service, so abort and report so a human or the system can fix the input. Service-unavailable errors such as 503 and 504 may warrant a few retries but signal a systemic problem if persistent, so escalate to a human if the service does not recover within the retry budget. Authorization errors such as 401 Unauthorized and 403 Forbidden are definitively non-transient because the agent's credentials are invalid or insufficient; retrying is pointless and may cause harm by triggering rate limits, excessive service calls, or credential lockout, so these require escalation for credential refresh, not retry.
The abort-on-any-failure approach is too conservative. Transient errors are common in distributed systems and expected. An agent that aborts its entire workflow on a single network timeout is fragile and operationally expensive because every transient error requires human intervention to restart.
The ask-the-user-on-every-failure approach creates excessive interruptions for routine transient failures. Users do not want to be paged at 2am because a service had a 200ms timeout. Human escalation should be reserved for errors that require human judgment, not mechanical recovery.