﻿# OpenHands fallback retries transient model failures per call

OpenHands FallbackStrategy tries saved alternatives for transient failures of a model call; each new request starts with the primary and non-transient errors are raised directly.

Author: Retrivium editorial team
Updated: 2026-11-04
Canonical URL: https://retrivium.ai/journal/guide-openhands-fallback-per-call/
Language: en

## Locate fallback at the model-call boundary

An agent's model request times out and an alternative model returns a response. The [OpenHands fallback guide](https://docs.openhands.dev/sdk/guides/llm-fallback) describes this as per-call behavior: each new request starts with the primary model again. This differs from switching the conversation's active model profile. A successful alternative call therefore does not establish that all later reasoning will use the same alternative route.

## Classify the error before expecting an alternative

Fallback applies to transient errors such as rate limits, timeouts and connection problems. Authentication failures and bad requests are raised without trying alternatives. The [exception guide](https://docs.openhands.dev/sdk/guides/llm-error-handling) supplies typed error categories. An invalid input schema should be corrected at its source; a list of fallback models is not a general-purpose way to make an unsupported request valid. Preserve the error class when reporting failure to the calling application.

## Resolve alternatives as usable profiles

Fallback configurations are referenced by saved profile names and tried in the specified order. The [profile-store guide](https://docs.openhands.dev/sdk/guides/llm-profile-store) explains the stored artifact and secret behavior. Verify that the strategy uses the intended profile directory and that loaded alternatives have working credentials and required capabilities. A model that can answer plain text may still be unsuitable for a tool-using task or a multimodal request.

## Preserve the original failure and actual usage

If all alternatives fail, the guide says the original primary error is raised. That exception alone does not enumerate every attempted route. Usage from fallback calls is merged into primary metrics, with model names available in usage records. Retain enough observations to distinguish a primary-only failure from an exhausted alternative list. Do not describe the primary model as having produced a response merely because the result arrived through its configured LLM object.

## Verify continuation against the task contract

A successful model response still needs to produce correct agent behavior and a verified artifact. [Response-contract guidance](/journal/learn-openrouter-response-contract/) distinguishes accepted output from completed application work; [tool observations](/journal/learn-codex-tool-observation/) tie later actions to real results. Record the active fallback order and model usage with the run. If task requirements depend on a particular capability or data route, assess alternatives before treating a transient-failure recovery as an equivalent execution.
