Agent Timeout Handling: Limits, Retries and the Next State

ProductionReliabilityPublished Updated By Simon Budziak

An agent timeout is the time limit an AI agent step gets before the system changes course. It applies to model calls, tool calls and whole workflow steps, stops hung dependencies and endless reasoning from consuming resources without progress, and defines what should cancel, retry, resume, or escalate next.

The OpenAI Agents SDK running-agents guide is the primary reference used for this definition and its production boundaries.

How does agent timeout handling work in production?

Set separate limits for model responses, tool calls, and the overall workflow. A background agent can wait longer, but it still needs a deadline and an agent checkpoint to resume from. A timeout without a next-state rule is only an error message. Write the rule down per step: cancel and report, retry under the agent retry policy, resume from the last checkpoint, or hand the case to a person.

How long should an agent timeout be?

Choose limits from observed latency and business deadlines, not from defaults. Measure the slow tail of each step, then fit the limits inside the latency budget the user experience allows. Remember that retries multiply the limit: three attempts at the same timeout can take three times as long before the agent learns the step failed. The outer workflow deadline must be longer than the inner limits it contains, or the workflow gives up while a step is still legitimately running.

How do we handle agent timeouts in our own systems?

We treat a timeout as missing information, not as a failure. In one of our outbound workflows, a batch of 55 invitations was recorded as failed after timeouts, and a check of the destination showed every one had actually been delivered. A timeout after the request left tells you the confirmation was lost, not that the action did not happen. So for any action with an outside effect, our agents never retry blindly on a timeout: they re-read the destination, mark the action done if it landed, and fail loudly if it did not.

In our scheduled agents, every web fetch a helper agent makes carries its own limit of 120 seconds, so no single fetch can run long. Each helper agent also has a ceiling for its whole task; past it, the controller stops it and starts one replacement with the same brief. If the replacement goes silent too, an optional part of the run is skipped and named in the report, and a required one fails the run loudly. Either way, the run never hangs.

What happens after an agent times out?

Preserve the last safe state, release anything the step was holding, and notify an owner when the work cannot continue on its own. Repeated timeouts against the same dependency are a signal to open an agent circuit breaker instead of retrying every request.

Written with AI assistance and reviewed by Simon Budziak. The production notes come from systems Soba Labs builds and runs.

Frequently asked questions

What is agent timeout handling?

It is the rule for what happens when a step runs out of time: cancel, retry, resume from a checkpoint, or escalate to a person, decided per step before production.

Should every agent step use the same timeout?

No. Model calls, human approvals, and external jobs operate on different time scales and need separate limits.

Does a timeout mean the tool call failed?

Not always. If the request already reached the other system, the action may have happened and only the confirmation was lost, so check before retrying.

Summarize this page with

Train your team to build this