# Decision Model Dispatch

How the decision model races the LLM dispatcher to decide the work kind, the model order and the reasoning level.

Whenever a decision model is set, each routed request runs the decision call and the LLM dispatcher at the same time; the first valid answer is used, and when the decision call fails the LLM dispatcher's answer is used. With no decision model set (`decision_model` empty or `off`), only the LLM dispatcher runs. There is no separate switch: `dispatcher_beta` (config field `DispatcherDecision`), the **Decision Model** entry of `/model` → `dispatch` and of the web Dispatcher list, and `POST /v1/model` `{dispatcher_beta}` were Removed in v1.3.2; set or clear the decision model instead, and a leftover `dispatcher_beta` in `config.json` is ignored.

The call asks up to three questions: what kind of work the request is, whether it explicitly asks for one of the candidate models, and — when the session has earlier turns and a recorded previous model — whether it continues the subject of the last user message. The work answer picks the tier order and the reasoning level:

| Work | Tier order | Reasoning |
|---|---|---|
| `code` | S > A > B > C | `xhigh` |
| `research` | S > A > B > C | `high` |
| `work` (the default for anything else) | A > S > B > C | `medium` |
| `chat` | B > C > A > S | `none` |
| `fetch` | C > B > A > S | `low` |

A model named in the request goes first; when none is named and the subject is unchanged, the session's previous model takes that slot so its prompt cache is reused. When the previous model leads this way, the reasoning level stays at the previous one whenever it is a valid level, and these leading picks are not reshuffled by provider priority; only the ranked candidates after them are. The previous model is recorded after each successful reply and expires after 30 minutes for `openai` / `codex`, 60 minutes for `gemini`, and 5 minutes for other providers. The remaining candidates are sorted by tier, reading `model_tag` first and falling back to the naming rules; within a tier, `claude-code` and then `codex` models come first, then ties break by model family. For `research` work, `copilot@` models move behind the others of the same rank because of Copilot's smaller context window. `pass` models are left out of this ranking. The request context is the last 4 user and assistant turns, each cut at 2,048 runes.

The TypeSafe/Jev beta dispatcher (`dispatcher_beta` calling `jev-latest` directly, with its own `TYPESAFE_API_KEY` prompt and the `missing_key` 400) was Removed in v1.3.1; the decision model above replaces it, and TypeSafe is now one of its providers.
