> ## Documentation Index
> Fetch the complete documentation index at: https://docs.restate.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Production checklist

> Settings to review before you run agents in production.

Most Restate Harness defaults suit development. Review these settings before you run agents in production.

## Model calls

* **Fit the timeouts to your slowest model call.** Restate receives no journal entry while a model call runs. After the [inactivity timeout](https://docs.restate.dev/services/configuration.md#timeouts), 1 minute by default, Restate asks the handler to suspend. If the attempt is still running after the abort timeout, 10 more minutes by default, Restate aborts it. If your model calls can take longer, increase these timeouts for the handlers that make the model calls: the agent's handlers, or the gateway's handler with [`modelGateway`](https://docs.restate.dev/harness/models#model-gateway). See [Timeouts between Restate and the service](https://docs.restate.dev/guides/error-handling.md#timeouts-between-restate-and-the-service).
* **Set the retry policy of the model.** By default, a model call makes three attempts, retried after 50 and 100 milliseconds unless the provider requests a longer delay, and the run then fails. Set `retry` on the model to recover from longer provider outages. See [Retries](https://docs.restate.dev/harness/models.md#retries).
* **Set `maxOutputTokens` if you expect long replies.** When it's unset, the provider chooses the limit, and a reply cut off at the limit fails the run. See [Reply limit](https://docs.restate.dev/harness/models.md#reply-limit).
* **Limit concurrent agents.** Use [concurrency limits](https://docs.restate.dev/services/flow-control.md) to control model spend.

## Limits and context

* **Check the run limits.** By default, a run takes at most 10 steps (`maxSteps`) and makes at most 128 tool calls (`maxToolCalls`). A run that reaches a limit returns the status `stopped`, so handle that status in your handler. See [Limits](https://docs.restate.dev/harness/agents.md#limits).
* **Set `contextWindow` to the model's context window.** Without it, compaction starts at 170,000 tokens, so a model with a window under 200,000 tokens overflows first, and the run recovers from an overflow only when the provider returns HTTP `413` or the error code `context_length_exceeded`. Any other overflow error fails the run. See [Context window](https://docs.restate.dev/harness/compaction.md#context-window).

## Tools

* **Set a retry policy on tools that call external APIs.** By default, an async tool makes three attempts, retried after 50 and 100 milliseconds, and the model then receives the error. See [Async tools](https://docs.restate.dev/harness/tools.md#async-tools).
* **Make external writes idempotent.** A tool can run again after a retry or a crash. Build an idempotency key from `invocationId`, the run's `name`, and `callId`. See [Async tools](https://docs.restate.dev/harness/tools.md#async-tools).

## Sessions

* **Preload only the conversation's metadata and summary.** By default, every invocation of the object receives the whole conversation. With Restate 1.8 or later, set `state: {preload: ["conversation/meta", "conversation/summary"]}` in the options of each object that uses `Conversation`, so that each invocation fetches only the chunks that it reads. See [Lazy state](https://docs.restate.dev/harness/sessions.md#lazy-state).
* **Send requests with an idempotency key**, so that a client that retries a request doesn't add a second turn to the conversation. See [Long runs](https://docs.restate.dev/harness/clients.md#long-runs).
* **Cancel stuck agents instead of killing them.** A cancelled run records a `cancelled` result with the reason for each unfinished tool call. See [Failed runs](https://docs.restate.dev/harness/sessions.md#failed-runs).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.