# LLM Fallback

What happens when a send fails on `auto`: retries on the same model, context trimming, then the next model in priority order.

Fallback applies only when a request runs on `auto`: a session pinned to a model, or a `/v1/chat/completions` call that names one, gets no fallback. A timed-out send is first retried on the same model up to three times (15 seconds apart) and a rate-limited one up to three times after 5, 10 and 15 seconds; a request over the context window stays on the same model: since v1.3.0 Agenvoy takes the smallest token count (at least 4,096) in the overflow error as that model's input limit for the rest of the process, trims the oldest history and tool steps until they are at most 80% of their size (`CONTEXT_OVERFLOW_KEEP_RATIO`), and sends again; since v1.3.1 it first prunes tool steps the decision model judges no longer needed. When nothing is left to trim the run ends with a `[Limit]` error. Any other failed send hands the request on: Agenvoy walks the priority order top to bottom, skips `pass` models and every model on the failed model's provider, health-checks each candidate (10-second timeout) and continues on the first that answers. When no candidate answers it starts another pass, up to four in total. The last non-`pass` entry is the final line of defense.

Skipping models whose context window cannot hold the input was removed in v1.2.1. Before v1.0.20 `pass` models were always moved to the end; from v1.0.20 to v1.0.27 fallback still tried them at their place in the order.
