Model retries and billing

When a model call fails, Oda can send the request again instead of ending the turn. This page covers the two retry modes a provider route can use, how long Oda waits between attempts, and what the extra attempts cost.

The two retry modes

Retrying is decided per route: each provider route carries its own retry policy, so two routes can retry differently. Provider route settings reference lists the setting with the route's other settings.

The retrying is Oda's: the model service never repeats a request by itself. Model calls and failures covers the kinds of failure a call can end in.

What each mode retries

Normal mode retries five kinds of failure:

Always mode retries those same failures, and it also retries problems that waiting cannot fix:

In Normal mode those three end the call; in Always mode they do not end it by themselves.

How long Oda waits before trying again

Oda does not repeat the request straight away: it waits between attempts, and each wait after the first is longer, up to a cap.

What retrying costs

Each attempt goes out as its own request to the model service, and it is billed like any other request.

Changing how a route retries

Each route carries its own retry policy. To change it:

  1. Open Settings > Models (Set up models and providers covers the page).
  2. Open the route and change its retry policy (Provider route settings reference lists the setting with the rest of the route's settings).
  3. Save. The change reaches the route in one step, with no moment where the route cannot serve; a call that is already running keeps the settings it started with, and the new policy applies from the next request.

Other problems you meet in Oda are listed in Updates and troubleshooting.

Questions, answered

Where do I change how a route retries a call?

On the route itself. Open Settings > Models, open the route's settings and change its retry policy; Set up models and providers covers the page. Each route carries its own, so two routes can retry differently.

What does Always mode do that Normal mode does not?

It keeps trying where Normal stops. Normal retries the failures that can pass (an empty answer, a rate limit, a server-side problem, a timeout, a connection that dropped) and gives up on the rest. Always also retries a refused sign-in or key, a spent quota, and a request the service will not accept, without a set limit.

Can a retry keep going forever?

In Always mode it can: the attempts have no set limit, so the requests keep going out until the call succeeds or you stop the turn. Normal mode stops after its allowed retries, five by default.

Is a retry billed again?

Yes. Each attempt is a separate request to the model service, and it is billed like any other request; a repeated attempt can charge the same input again. In Always mode, a problem that cannot pass keeps sending billed requests until you stop the turn.

How long does Oda wait before trying again?

Each wait is a short pause, and every wait after it is longer, up to a cap. If the service sends a wait of its own, Oda honours it when it fits the policy's bounds.

Does a retry send the same request again?

Yes. The failed step is sent again as it was: the failed attempt's partial output is not kept, and nothing from the failure is added to it. A retry repeats the step that failed, not the work before it.

Does the model see that a call was retried?

No. The retry happens between Oda and the model service; nothing about it reaches the model, and a retried request reads to the model like any other request.

Will a change to the retry mode disturb a call that is running?

No. The change reaches the route in one step, and a call that is already running keeps the settings it started with; the new policy applies from the next request.

Where can I see that a retry happened?

In the chat, a retry row shows the wait and the attempt while they happen; Failures and recovery covers the rows. The chat's log also records each retry, the wait it scheduled first and the attempt that followed (Chat logs on disk shows where the log lives).

Why was my retry policy refused?

Two cases. A retry policy that is not placed under a provider route is refused: it belongs under each route. A retry setting the policy does not recognise is refused as well, instead of being ignored.