<!-- Markdown mirror. Canonical: https://empryo.com/docs/context/provider-options -->

# Thinking, effort & retries

> Control how much the model thinks before answering, set reasoning effort per model or provider, and tune retries when a provider is rate-limiting you.

Many models can "think" before they answer. More thinking often means better answers on hard problems, but it also costs more and takes longer. This page covers the settings that control that trade-off, plus how Empryo retries when a provider is busy.

Open `/provider-settings` in the terminal UI, or **Provider Options** in the desktop settings, to change these per model. You can also edit config directly:

```json
{
  "thinking": {
    "mode": "adaptive"
  }
}
```

## Thinking mode

| Mode | What it does |
|------|--------------|
| `off` | No thinking |
| `auto` (default) or `adaptive` | The model decides when and how much to think, where supported. Other models use a fixed budget |
| `enabled` | Always think, up to a fixed token budget |

When the mode is `enabled`, set the budget with `thinking.budgetTokens` (at least 1024). `/provider-settings` offers 1024, 2048, 5000, 10000 and 20000.

## Reasoning effort

Some models take a thinking *budget* in tokens. Others take an *effort level* instead. Set the level from the control in the message box, with `/effort`, or in config:

```json
{
  "performance": {
    "effort": "high"
  }
}
```

The levels, from least to most thinking: `off`, `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, `max`.

No model supports all of them. The control only offers levels your current model accepts. If you set a level higher than a model supports, it uses the highest level that model accepts. Choosing a level never turns reasoning off.

When settings overlap, the first match in this order wins:

| Where | Key | Applies to |
|-------|-----|------------|
| Per model family | `performance.effortByFamily` | Set from the quick switch in the message box, one level per family |
| Per provider | `performance.openaiReasoningEffort` and similar | Every model from that provider |
| Everywhere | `performance.effort` | Every model that takes a level |

The per-provider keys:

| Key | Provider |
|-----|----------|
| `openaiReasoningEffort` | OpenAI |
| `googleThinkingLevel` | Gemini |
| `xaiReasoningEffort` | Grok |
| `deepseekReasoningEffort` | DeepSeek |
| `groqReasoningEffort` | Groq |
| `openrouterReasoningEffort` | OpenRouter |
| `llmgatewayReasoningEffort` | LLM Gateway |
| `compatReasoningEffort` | Any other OpenAI-compatible endpoint, including coding plans |

## Anthropic context options

Anthropic offers a few extra ways to manage long conversations on its side. Set them in `/provider-settings` or under `contextManagement` in config:

- **Keep thinking blocks** (`clearThinking`, on by default) keeps earlier thinking in the conversation, which keeps requests consistent from turn to turn.
- **Clear old tool uses** (`clearToolUses`, off by default) removes old tool results once the conversation passes 65% of the context window (and at least 120,000 tokens).
- **Server-side compaction** (`compact`, off by default) lets Anthropic compact the conversation on models with a context window of 200,000 tokens or more.

Empryo also has its own [compaction](/docs/context/compaction), which works with every provider.

## OpenAI server-side compaction

The OpenAI provider settings now expose the same `contextManagement.compact` switch. It is off by default. For first-party OpenAI GPT-5.2 and newer, Empryo can send a large, self-contained Responses request through [`/responses/compact`](https://developers.openai.com/api/docs/guides/compaction) before inference. It forwards the entire returned context window, including its encrypted compaction item, as the next request's input.

This is per-request input reduction. Empryo keeps its readable conversation history and recomputes the compacted input on subsequent large requests. Compaction calls add latency and token cost. Their usage is recorded separately. Empryo's normal client-side compaction remains active.

This path does not change ChatGPT subscriptions, Codex or custom providers. Requests using `previous_response_id`, conversations, item references or explicitly configured `context_management` stay on their existing path. A compaction failure or 30-second deadline reports the problem and sends the original request instead. Cancelling the caller stops both requests.

## When a provider rejects an option

If a provider rejects a setting, for example a thinking mode the model doesn't support, Empryo retries the request with fewer options instead of failing.

## Retries when you're rate-limited

When a provider returns errors like 429 (too many requests), 529 or 503, or a response stalls, Empryo waits and tries again. If you hit limits often, raise the retry settings:

```json
{
  "retry": {
    "maxTransientRetries": 5,
    "baseDelayMs": 3000
  }
}
```

The wait roughly doubles after each attempt: with a 3-second base, that's about 3s, 6s, 12s, 24s, then 48s.

| Key | Default | Range | What it controls |
|-----|---------|-------|------------------|
| `maxTransientRetries` | `3` | 1 to 10 | Retries for errors like 429, 529, 503 and timeouts |
| `maxStallRetries` | `3` | 1 to 10 | Retries when a response stops arriving |
| `baseDelayMs` | `1000` in chat, `2000` for agents | 250 to 60000 | Wait before the first retry, in milliseconds |

The older `maxAttempts` key still works and sets both retry counts.

## Stream helper requests

Some providers throttle non-streaming requests more heavily than streaming requests. If helpers hit rate limits while main chat works, enable internal streaming for that provider. It works with any provider: built-in API-key providers, subscriptions, gateways, and custom providers from `providers`. Off by default.

Select a chat model from the provider you want to configure, then:

- **Terminal:** open `/provider-settings`, choose **General**, and toggle **Stream helper requests**.
- **Desktop:** open **Settings → Provider Options → Shared**, and toggle **Stream helper requests**. Search settings for "helper streaming" to find it.

The row names the current provider. It always writes a global setting, even if the panel scope is Project. It applies to the next helper request, including helpers using other models from that provider. Switching it off keeps other providers' choices.

Helpers consume the stream internally, then return the finished report as before. Main chat, tool execution and result formatting stay unchanged. This applies to dispatched helpers and their recovery attempts, not every background model call. It does not bypass shared quotas or guarantee fewer rate limits.

The global config key is a list of provider ids, not model ids or names. The id is the part of the model id before the first `/`: `openrouter/qwen/qwen3.8-max` belongs to `openrouter`, and a custom provider named `my-proxy` is `my-proxy`. `empryo --list-providers` prints every id.

```json
{
  "subagentStreamProviders": ["openrouter", "my-proxy"]
}
```

You can also ask Empryo to enable helper streaming for a provider. The agent uses the `settings` tool with the `subagentStreamProviders` key and global scope. Project config cannot override it. An empty list disables the opt-in.

For a one-off headless run, override the list with a comma-separated environment value:

```sh
EMPRYO_SUBAGENT_STREAM_PROVIDERS=openrouter,my-proxy empryo --headless "Check this project"
```

The environment list replaces the saved list. An explicitly empty value disables it for that process:

```sh
EMPRYO_SUBAGENT_STREAM_PROVIDERS= empryo --headless "Check this project"
```

Remove the environment variable to use the saved setting again. If the toggle has no effect, check the environment of the process running Empryo.

## Speed, service tier and tool calls

These live under `performance` in config. Each command shows its current value when you run it alone.

| Field | Command | What it does |
|-------|---------|--------------|
| `speed` | `/speed` | `fast` turns on fast mode on Claude models that offer it. `off` (default) and `standard` leave it off. |
| `serviceTier` | `/tier` | OpenAI service tier: `auto`, `default`, `flex`, `priority` or `ultrafast`. `off` (default) sends none. |
| `openaiVerbosity` | | How long OpenAI answers are: `low`, `medium` or `high`. `off` (default) leaves it to the model. |
| `sendReasoning` | `/sendreasoning` | Send the model's reasoning back with the next request. Off by default. |
| `toolStreaming` | `/toolstream` | Stream tool-call arguments while the model writes them. On by default. |
| `disableParallelToolUse` | `/seqtools` | One tool call at a time instead of several at once. Off by default. |
| `codexWebsocket` | | Send ChatGPT subscription requests over a websocket: `auto` (default), `on` or `off`. |

`/thinking` and `/budget` set the thinking mode and budget from the chat in the same way. For Anthropic's context options, `/cleartools` and `/clearthinking` set `clearToolUses` and `clearThinking`.

## Next

The same settings panel also has the four [provider tools](/docs/context/provider-tools): computer use, code execution, the Anthropic text editor and provider-side search. Each row shows whether the tool is available on the model you've selected.
