@alexeiled/claude-router 1.22.1 → 1.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "router",
3
3
  "displayName": "Router",
4
- "version": "1.22.1",
4
+ "version": "1.23.0",
5
5
  "description": "Native model and effort routing within your provider. Anthropic, DeepSeek, z.ai, MiniMax, MiMo and Kimi defaults, custom provider profiles, classifier advice and one model per subagent.",
6
6
  "author": {
7
7
  "name": "Alexei Ledenev",
package/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.23.0 (2026-11-15)
4
+
5
+ ### Changed
6
+
7
+ - Route adaptive ops by phase without changing the durable goal: accepted `reason` uses the same-tier `debug` preference; `produce` uses `code`. Accepted bounded `verify`/`execute` keeps the ops preference. Active modes, explicit user cells and existing switching gates still apply. An inherited weaker generic cell does not replace a stronger ops preference.
8
+ - Do not introduce a new ops discount for reporting or weak/missing/unknown phase. Keep an eligible continuation; consider the existing generic baseline on fresh uncertainty.
9
+ - Prefer Haiku 5.5 High in automatic quality selection, with one exception: medium bounded ops may use Xhigh. Deliberate higher settings, pins and other providers' supported efforts remain unchanged. The Xhigh empty-answer risk is provider-documented, not reproduced by the High-only pilot.
10
+ - Use declared `strength` ranks for capability and subagent direction, never tariffs. Unknown ranks stay unordered; prices remain economics inputs.
11
+ - Preserve accepted intent across equal pairs, upgrades, window restoration and refits. Refusals retain incumbent intent; phase-derived switches require actual support with unchanged labels.
12
+ - Label every cost readout as a configured-rate API estimate, including plan, credits and mixed profiles. `≈` marks estimates, not invoices or measured quota savings.
13
+
14
+ ### Added
15
+
16
+ - `/router` distinguishes selected settings, the last recorded completed engine request and response-reported model. API-transmitted/served effort stays unknown. Existing event/coverage counters do not claim task acceptance.
17
+
18
+ ### Upgrade
19
+
20
+ Restart Claude Code after updating. In custom mixed profiles, declare intended model `strength` ranks before relying on strength-based cross-model continuation or observed upgrades; unranked models are no longer ordered by price. No account, permission or provider configuration is changed automatically.
21
+
3
22
  ## 1.22.1 (2026-11-13)
4
23
 
5
24
  ### Changed
@@ -1,7 +1,8 @@
1
1
  # Activity routing
2
2
 
3
3
  The router uses **tier** for difficulty, **goal** for the task's final deliverable, and **phase** for the current step.
4
- The route uses the goal's activity unless a supported verification-only or execution-only phase qualifies for `ops`.
4
+ The route uses the goal's activity and the current work preference: bounded commands can use `ops`, while adaptive
5
+ operations use the profile's same-tier reasoning or code preference. The durable goal does not change.
5
6
  Activity routing is `on` by default. This page shows the default choices, why each one is there, and how to
6
7
  change them.
7
8
 
@@ -12,7 +13,7 @@ They do not measure this router's answer quality or your bill.
12
13
 
13
14
  For each new turn, Jev, Clef and OpenAI answer tier, continuation, goal and phase questions together. The existing
14
15
  `activity` field and route matrix name the goal; the phase can select the `ops` cell for bounded command-only work.
15
- Ollama asks tier and goal in two calls and does not provide a phase, so it uses the goal route. A route is a model and an effort.
16
+ Ollama asks tier and goal in two calls and does not provide a phase, so it cannot introduce a bounded-ops discount. A route is a model and an effort.
16
17
 
17
18
  | Goal | The task produces |
18
19
  | --------- | --------------------------------------------------------------- |
@@ -30,7 +31,30 @@ Tests **and fixes** are not verification-only. A terminal command by itself does
30
31
 
31
32
  When both the goal and a `verify` or `execute` phase meet `policy.activityMass`, the router considers the
32
33
  `ops` cell. It uses the lower of their supports for the existing activity-switch gates; it does not multiply them
33
- or claim they are independently calibrated. A missing, malformed, uncertain or weak phase keeps the goal route.
34
+ or claim they are independently calibrated. For goal `ops`, accepted `reason` uses the same-tier `debug` cell and
35
+ accepted `produce` uses `code`, including the active routing mode and explicit user cells. It never substitutes a
36
+ possibly weaker generic route for adaptive work: a mixed cost profile can keep DeepSeek at medium while its generic
37
+ medium is GLM Flash. These are work preferences, not new activities or universal model-quality scores. Explicit debug/code cells,
38
+ including an explicit use-tier cell, remain authoritative. If a missing cell merely inherits a generic route that
39
+ is declared weaker than ops, the stronger ops preference is retained; unknown suitability is not inferred from price.
40
+ An explicit debug/code floor may be nominated on a continuation even when model order is unknown, but confidence,
41
+ cache, escalation-hold, cash and eligibility gates still decide. An inherited unknown generic cell gets no exception.
42
+
43
+ When the bounded ops pair and its accepted reasoning/code preference are identical, the semantic preference still
44
+ applies before tier policy: a later high-tier upgrade must use the work floor, not bounded ops. A protected physical
45
+ ops cell keeps accepted work intent separately for later tool-context or modality refits. A nomination is not
46
+ acceptance: confidence, hold, cash and eligibility refusals keep the incumbent's accepted intent (or none), including
47
+ when its activity label matches the proposal. Refits use that accepted outcome, never a rejected role. If a
48
+ smaller-window proposal is rejected because context/history is unmeasured, restored and fallback cells each resolve
49
+ their own accepted floor; native/base alternatives retain their existing eligibility.
50
+ A physical change derived from the current phase uses the lower of goal and phase support, even if the label is
51
+ unchanged. Genuine mode/configuration changes to an already accepted preference retain their usual support rules. That transient intent
52
+ clears with a history reset, superseding advice or observed upward move, pin/off mode, or native-unavailable fallback;
53
+ it never creates a new goal or bypasses eligibility gates.
54
+
55
+ For goal `ops`, `report` or a missing, malformed, uncertain or weak phase introduces no new ops discount: a continuation
56
+ keeps its eligible incumbent, and a fresh task considers the existing generic tier route through the usual gates.
57
+ Other goals keep their normal activity preference when phase is unclear.
34
58
  The usual cache, dwell, escalation, model availability, context and credits checks still apply. A background phase answer expires when newer messages have arrived since its snapshot; stale bounded-command evidence cannot justify a cheaper step. A successful
35
59
  classifier decision displays goal, phase and the route activity separately. Pins ignore activity routing.
36
60
 
@@ -90,9 +114,10 @@ show about that shared cache, and its limits.
90
114
 
91
115
  - It is weakest at code. Terminal-Bench 4.0: Haiku 39.2%, Sonnet 70.6%, Opus 66.4%. SWE-bench Pro: 64.8%, 81.3%,
92
116
  89.9%.
93
- - Its quality depends on effort more than the larger models do. The defaults use `medium` and `high`.
94
- - Avoid `xhigh` in multi-turn chats. Anthropic reports that Haiku then sometimes puts the whole answer in its thinking
95
- and shows no reply.
117
+ - Its quality depends on effort more than the larger models do. Automatic `quality` selection prefers `high`,
118
+ with one exception: bounded `ops` at `medium` may use `xhigh`. Explicit higher settings and pins remain supported.
119
+ - Anthropic documents an `xhigh` risk in multi-turn chats: Haiku sometimes puts the whole answer in its thinking
120
+ and shows no reply. This was not reproduced by the High-only pilot; the preference is not a provider-wide effort cap.
96
121
  - Above 100,000 tokens of context, Anthropic charges 5 times Haiku's list price. Even then it costs at most a quarter
97
122
  of what Opus costs per token, and against Sonnet a quarter for input and output and half for cache reads.
98
123
 
@@ -91,11 +91,22 @@ The router decides on a _cell_: a tier and an activity. The route is `{ ...route
91
91
  `chooseRoute` decides at a turn's first step, and again on each review answered inside the turn:
92
92
 
93
93
  1. **Pin.** A pinned tier wins, with no activity: the pin's tier route.
94
- 2. **Activity.** Only in `on`; derive the route activity from the goal and a supported phase, with bounded verify/execute using `ops`. Missing phase keeps goal routing. Progress origins cannot justify downgrades. `off` uses none, and ignores the activity a turn in `on` ran with before the mode changed. With no advice, or advice without an activity answer, the incumbent's activity stays. On the same task (`sameTaskOf`; reviews and progress origins count as same-task even without a continuation answer, including Ollama) a label whose route at the incumbent tier is stronger applies at once, and a weaker one only with at least `downgradeMass` probability once `facts.downAllowed` holds; an unclear label keeps the running activity. Otherwise the activity with probability at least `activityMass` applies; below that, or for `uncertain`, there is none and the tier's base route is used.
94
+ 2. **Activity.** Only in `on`; derive the route activity from the goal and a supported phase, with bounded verify/execute using `ops`. For goal `ops`, accepted reason/produce uses same-tier debug/code; report or unclear phase keeps an eligible continuation or considers the fresh generic baseline, without a new ops discount. Other goals keep goal routing when phase is unclear. Progress origins cannot justify downgrades. `off` uses none, and ignores the activity a turn in `on` ran with before the mode changed. With no advice, or advice without an activity answer, the incumbent's activity stays. On the same task (`sameTaskOf`; reviews and progress origins count as same-task even without a continuation answer, including Ollama) a label whose route at the incumbent tier is stronger applies at once, and a weaker one only with at least `downgradeMass` probability once `facts.downAllowed` holds; an unclear label keeps the running activity. Otherwise the activity with probability at least `activityMass` applies; below that, or for `uncertain`, there is none and the tier's base route is used.
95
95
  3. **Tier.** The tier policy runs as before, with every candidate tier priced at its route for the activity and the incumbent at the route it runs. Repeated tool errors move to the lowest tier above whose route is stronger than the running one, or sends a request that cannot be ordered against it. With no activity that is one tier up, as in 1.5. If no tier above helps, nothing escalates and the failure signature is kept.
96
- 4. **Lateral move.** If the tier stays and the route would change, `lateralMove` decides. Routes order by explicit model strength when both models declare it, otherwise by output price, then effort; a session effort counts as the effort Claude Code sends. Two routes that send the same request do not switch. A pair that cannot be ordered (an unpriced model, a numeric effort, two models at one price) counts as a move up, so the base route is always reachable. A stronger route needs the activity's probability to clear the upgrade bar for its switching tax (a base route with no activity counts as probability 1). A cheaper route needs its downgrade tax to be paid back within `downgradeHorizonTurns`, except before the first measured reply of a history, when there is no cache to protect. The cash gate applies to both. The result is `activity-up`, `activity-down`, `activity-pending` (stay on the running route and its activity), `cash-gate`, or `hold`. While an escalation hold lasts, only a stronger route may be taken. One vote is enough for a proposed activity cell, but the labels remain model estimates, not observed facts. If the tier changes, the tier gates have already priced the new route, and no lateral rule applies.
96
+ 4. **Lateral move.** If the tier stays and the route would change, `lateralMove` decides. Routes order by declared model strength, then effort. Unknown ranks stay unordered regardless of tariffs; prices remain economics inputs. A session effort counts as the effort handed to Claude Code, not verified API-transmitted effort. Two routes that send the same request do not switch. A pair that cannot be ordered (unknown model strength or an unresolved/numeric effort) counts as a move up, so the base route is always reachable. A stronger route needs the activity's probability to clear the upgrade bar for its switching tax (a base route with no activity counts as probability 1). A cheaper route needs its downgrade tax to be paid back within `downgradeHorizonTurns`, except before the first measured reply of a history, when there is no cache to protect. The cash gate applies to both. The result is `activity-up`, `activity-down`, `activity-pending` (stay on the running route and its activity), `cash-gate`, or `hold`. While an escalation hold lasts, only a stronger route may be taken. One vote is enough for a proposed activity cell, but the labels remain model estimates, not observed facts. If the tier changes, the tier gates have already priced the new route, and no lateral rule applies.
97
97
  5. **Fit.** Context fit and model availability resolve through `route(tier, activity)`. A fallback tries the last cell, the native model's cell, then each tier with the activity. The last and the native cell count only when they carry no activity or the turn's; otherwise, or when nothing fits, the native model runs at the session effort.
98
98
 
99
+ `decision.floorActivity` retains accepted ops reasoning/code intent separately from a protected physical ops cell.
100
+ Equal physical pairs can adopt the semantic preference without a switch before tier policy. Nomination carries
101
+ provenance through `chooseCell`/`decideCell`; lateral refusal restores the incumbent's accepted floor, not the proposed
102
+ role. Same-label physical changes introduced by a new phase projection use min(goal, phase) support, not the support
103
+ of 1 reserved for operator mode/config changes. Context/availability refits consume the post-gate accepted projection.
104
+ Every configured alternative resolves its own floor provenance, including after an unmeasured-window restore or a
105
+ last/native fallback. The existing rule for keeping the actual incumbent request remains separate and unchanged.
106
+ `continueRoute` projects that accepted preference per tier when context/modality requires a new eligible route. The field belongs to the accepted
107
+ turn decision: new advice recomputes it; history reset, observed upward supersession, pin/off and native-unavailable
108
+ fallback clear it. Existing host session/generation/review fences still own when a decision can apply.
109
+
99
110
  **Observed move.** On each later step of the turn, `observedMove` reads the turn's tool calls since its prompt, or since the transcript snapshot of the last review applied inside the turn (`loop.observedFrom`), since the review already judged the earlier ones, (`observedActivity`: `code` after an edit to a non-doc file, `docs` after edits to doc files only, else `ops`, `read` or `talk`). When that activity's route at the decision's tier is stronger than the running one, the remaining steps take it, with reason `activity-up` and `lastActivity` set, so the next turn starts there. The tier is fitted to the context first, so the gates price the route that will run. It goes through `lateralMove` with probability 1: the tools are the evidence, so the switching tax never holds it back (the upgrade bar tops out near 0.9), and only the cash gate can. The turn's reply label (`turnActivities.label`) follows the move; the classifier's answer stays as recorded. It never moves down, and skips pinned turns and `off`. `canMoveUp` skips the transcript read when no activity's route at the tier is stronger, so a step on the strongest route costs nothing. A move to a smaller window waits for a measured context, as in `routeTurn`. Context fit and model availability then apply as for any continuation.
100
111
 
101
112
  **Review inside a turn.** Every `reviewEveryRequests` requests after the last classifier answer (`loop.reviewedAt`, counted in `loop.requests`), `reviewMidTurn` reads the transcript and asks the active classifier in the background, with the turn's prompt and recent dialogue and `facts.midTurn` set. The classifier reads text only: the dialogue holds user and assistant text, not tool calls, results or edits. The policy reads those itself (`observedMove`, repeated failures, `completedSince`). The step does not wait. The first step after the answer arrives runs `chooseRoute` on it, before the observed move, with only the advice taken from the review: the checkpoint, context and cache facts are read at that step. Tier and activity move by the same rules as a continuation prompt: up on votes, down only past `downAllowed`. A pinned turn, a failed read or ask, an answer without advice, and an answer about a replaced history (another `generation`) change nothing; turn completion and session end abort a review in flight. `observeResponse` counts each request and records the request and message count at which the requested (model, effort) last changed (`switchedAt`), which the dwell and the verification window start from. A failed transcript read keeps the running route. A verification is a Bash command whose status is the check's: a checker (`pytest`, `tsc`, `eslint`, …) or a launcher whose subcommand names a check (`npm test`, `npm run lint`, `go test`, `make lint`, `uv run pytest`), alone or in an `&&` list. A pipeline, `;`, `||` or background job does not count, since its status can hide a failed check; neither do a `--version` or `--help` run, an option before the subcommand (`npm --prefix test install`), package names, paths and file names, nor a command Claude Code sent to the background, by request or after a timeout. The first response a loop serves also sets `switchedAt`, so checks from before the router chose a route do not count. When compaction or a rewind shortens the history, `prepareLoop` moves `switchedAt.messageCount` and `observedFrom` back to its end and keeps the request-based dwell.
@@ -168,7 +179,7 @@ A subagent's model is chosen once, in the `agent.spawn` hook, before its cache e
168
179
 
169
180
  `spawnAgent` in `hooks/native-router.mjs` passes the spawn through unchanged for a fork, a workflow agent (before the explicit check, since a workflow `agent({ model })` has `e.model` set), an explicit `e.model`, or a teammate (`passReason` in `lib/subagents.mjs`). Then `typeRoute` decides. A `subagents.types` entry wins; a key without a colon matches only the engine's built-in of that name. An unlisted built-in passes (`unlisted`), since its definition is not on disk. Any other agent is routed by its definition. `agentDefinition` finds the file once per provider and type in a session; a read that fails is tried again at the next spawn of the type. A plugin agent's `provider.plugin` is `plugin@marketplace`, the key of `<profile>/plugins/installed_plugins.json`, whose `installPath` entries hold `agents/*.md`. Other agents are looked up under the session's `.claude/agents`, then `<profile>/agents`. `agentFrontmatter` reads `name`, `model` and `modelRouting` from YAML or a one-line JSON object. No model, `inherit`, or `modelRouting: auto` is routed; any other model passes (`pinned`); a file not found, unreadable, or matches that disagree pass (`unknown`). A routed agent's type uses its models key, or for `classify` the active classifier is asked with the description and prompt alone, clipped to `context.maxTextChars`, with no history and no tool results. The answer maps to `subagents.heavy` when `P(high) ≥ heavyMass`, to `light` for an `explore` activity above `activityMass` or tier `micro`, else to `standard`. The spawn path has its own classifier client per classifier: its own failure count and pause, and no in-flight slot, so parallel spawns each get an answer and spawn failures never pause main-turn routing. Its deadline is the classifier's, capped at 3 seconds. That bounds how long a subagent waits to start. No advice, a missing key, a model `availableModels` blocks, or settings that cannot be read keep core's model. The router sends the configured full id, never an alias, because a family alias resolves to the parent's exact model when the families match. A `.catch` runs `next(e)`, so a failing hook spawns the agent as Claude Code would. Routing off (`/router off`, `/model`) or unavailable passes every spawn through and records nothing.
170
181
 
171
- Every spawn in `on` gets a record keyed by `agentId`, from `next(e)`'s answer. Its replies are priced in `turn.step` (`addAgentReply`), on the model they ran on and on core's model as `coreModelOf` estimates it (the definition's own model, else `CLAUDE_CODE_SUBAGENT_MODEL` except for Explore and Plan without `CLAUDE_CODE_SUBAGENT_MODEL_FORCE`, else `parentModel`). Cache writes are priced at the subagent lifetime (`subagentCacheTtl`). The spawn record also keeps `move` (`moveOf`): `up` or `down` when the routed model's output price is above or below core's, `moved` when either has no price, null for the same model. The record's counts go to this session's `$.store` key `subagents:v1:<session id>` at each of the agent's `turn.complete`s, and at session end for agents still running. Since 1.14.0 the value is version 2, by local calendar day like the usage records, and days past 400 leave it when it is written: per day, per type and per pass-through reason, the agents, requests, priced requests, respawns (a spawn of the type its parent loop finished one of in the last 10 minutes) and classifier failures, and per model id the agents ran on, the agents, the agents moved, up and down, the routed cost and core's. An agent counts on the day of its first flush; its later requests and cost on the day of each flush. A version 1 value has no days or models: it reads as `undated` agents and cost, which only the Session and All periods add. The records follow the usage records: one writer per key, the view's `subagentStore` is every session's sum and `subagentSession` this session's, and the same reset marker applies. **Delete history** clears them too. The view's `subagentsRunning` counts the agents with a record between a spawn or a step and their turn's end; it is in memory, so a reload starts it over. The band in a subagent's transcript reads the agent's record from memory too.
182
+ Every spawn in `on` gets a record keyed by `agentId`, from `next(e)`'s answer. Its replies are priced in `turn.step` (`addAgentReply`), on the model they ran on and on core's model as `coreModelOf` estimates it (the definition's own model, else `CLAUDE_CODE_SUBAGENT_MODEL` except for Explore and Plan without `CLAUDE_CODE_SUBAGENT_MODEL_FORCE`, else `parentModel`). Cache writes are priced at the subagent lifetime (`subagentCacheTtl`). The spawn record also keeps `move` (`moveOf`): `up` or `down` when the routed model's declared strength rank is above or below core's, `moved` when either rank is unknown or both are equal, null for the same model. The record's counts go to this session's `$.store` key `subagents:v1:<session id>` at each of the agent's `turn.complete`s, and at session end for agents still running. Since 1.14.0 the value is version 2, by local calendar day like the usage records, and days past 400 leave it when it is written: per day, per type and per pass-through reason, the agents, requests, priced requests, respawns (a spawn of the type its parent loop finished one of in the last 10 minutes) and classifier failures, and per model id the agents ran on, the agents, the agents moved, up and down, the routed cost and core's. An agent counts on the day of its first flush; its later requests and cost on the day of each flush. A version 1 value has no days or models: it reads as `undated` agents and cost, which only the Session and All periods add. The records follow the usage records: one writer per key, the view's `subagentStore` is every session's sum and `subagentSession` this session's, and the same reset marker applies. **Delete history** clears them too. The view's `subagentsRunning` counts the agents with a record between a spawn or a step and their turn's end; it is in memory, so a reload starts it over. The band in a subagent's transcript reads the agent's record from memory too.
172
183
 
173
184
  ## Classifier deadline and failure handling
174
185
 
@@ -59,7 +59,7 @@ These are estimate inputs, not an invoice; z.ai plan quota uses its own multipli
59
59
  A weekly GitHub Actions job (`.github/workflows/prices.yml`) runs `npm run prices:check`. It reads the Anthropic, DeepSeek, Kimi, MiniMax and z.ai price pages, compares them with `lib/prices.mjs`, and opens a pull request when a price, a long-context tier or DeepSeek's peak hours change. A page it cannot read opens a "Price check failed" issue. The MiMo page needs a browser, so the job lists it for a person to check. The pull request needs the repository setting **Allow GitHub Actions to create and approve pull requests**, and CI starts on it once a maintainer closes and reopens it. Run the check yourself with `npm run prices:check`; add `-- --write` to rewrite `lib/prices.mjs`. Prices in `router.json` always override the built-in ones.
60
60
  All non-Anthropic built-in presets use `billing: "credits"`.
61
61
  For an included-plan model, set `billing: "plan"` to disable the cold-input cash cap.
62
- `billing` does not change a price: the pane prices plan and credits models alike, at list prices, and labels the plan part `≈ API value` and the credits part billed; see [how dollars are paid](user-guide.md#how-dollars-are-paid).
62
+ `billing` does not change a price: the pane prices plan and credits models at configured API rates (list/custom), labels every total `API estimate` with `≈`, and identifies the mixed credits subtotal as an estimate, not an invoice; see [how dollars are paid](user-guide.md#how-dollars-are-paid).
63
63
  A provider name or URL does not establish its billing product.
64
64
 
65
65
  ### Provider cache behavior
@@ -151,9 +151,17 @@ Default model settings:
151
151
 
152
152
  Prices are configured list-price inputs for estimates. They are not a subscription bill or a claim of savings. Haiku 5.5 lists these prices for prompts up to 100,000 tokens and five times each of them, cache reads and writes included, above that. Its default `longContext` is `{ "above": 100000, "multiplier": 5 }`: a request whose prompt, counting input, cache reads and cache writes, is over `above` tokens is priced at `multiplier` times every rate. Every estimate prices through it. Set `"longContext": null` to remove it, for example when you point the `haiku` alias at another model with `id`. A model with `"efforts": []` receives no effort field. A route in `router.json` without an `effort` takes the effort of that tier's default route. To keep the session effort, clamped to what the model supports, set `"effort": null`, for example `"routes": { "high": { "model": "opus", "effort": null } }`. A 1.3 file whose `low` route had no `effort` kept the session effort; in 1.4 it runs at `high` until you add `"effort": null`.
153
153
 
154
+ `models.<alias>.strength` declares an ordinal policy rank, not a measured quality score. Built-in Claude ranks are
155
+ Haiku 1, Sonnet 2, Opus 3 and Fable 4. Cross-model capability comparisons require both ranks; equal ranks compare
156
+ supported effort. Prices affect economics only, never establish strength. A custom model without a rank stays
157
+ unordered, even when priced. Set explicit ranks in mixed profiles when strength-based continuation/observed upgrades
158
+ should recognize their intended order. An accepted ops work phase may still nominate its explicit debug/code cell
159
+ at unknown order, subject to the existing lateral gates; inherited generic cells get no such exception. Changing a preset alias to another model ID drops its inherited rank unless
160
+ you explicitly provide `strength`; changing its tariff does not. Known `[1m]` context hints retain identity.
161
+
154
162
  ## Activity routing
155
163
 
156
- The classifier names the task goal separately from its current phase. The existing `activities` matrix still selects routes; a supported command-only phase can select `ops` without changing the goal. `activityRouting` decides what the router does with it. [Activity routing](activity-routing.md) explains the defaults for end users.
164
+ The classifier names the task goal separately from its current phase. The existing `activities` matrix still selects routes; a supported command-only phase can select `ops` without changing the goal. For goal `ops`, accepted `reason` selects the same-tier `debug` preference, and `produce` selects `code`, after mode transformation. Unclear/report phase retains an eligible continuation or uses the fresh generic baseline, not a new ops discount. `activityRouting` decides what the router does with it. [Activity routing](activity-routing.md) explains the defaults for end users.
157
165
 
158
166
  | `activityRouting` | Behavior |
159
167
  | ----------------- | ------------------------------------------------------------------------------------------ |
@@ -34,12 +34,12 @@ Mode belongs to a Claude Code session. Clear starts a new session with routing o
34
34
  The status band is one line above the prompt: a tier meter, the model, the activity, a short reason, classifier support and the switch cost, and context and cache use. Segments drop by priority when the band is narrow: classifier support and the switch cost first, then context and cache, then the activity, then the reason. Hovering reveals a pin per tier, **Turn off**, and a two-row view whose second row shows the plan windows on a Claude plan and the session's cost against no routing; while routing is off, **Turn on** sits on the band itself, so the band carries one routing control at a time. A fresh session that starts with routing off because of its model shows `not a routing tier` on the band until the mode changes. The band yields to surveys. In a subagent's transcript it names the agent's model and who picked it, such as `agent ■ Haiku 5.5 ↓ from Opus 5.5 (Claude Code’s pick)`; without a record of the agent it reads `agent · model chosen at spawn`, or `agent · keeps its own model (subagent routing off)`. A model change between turns raises a toast. A pin, or a step that changes only the effort, such as `medium` to `high` on the defaults, raises none. While the classifier runs, the turn's spinner says `Choosing model`. In Manual mode or when routing is unavailable, the prompt footer carries `routing off` or `routing unavailable`. The **Router** button opens the pane. The pane has five numbered tabs, Now, Routes, Policy, Classifier, and Usage, under one `ROUTER` line with the routing on/off pair and the classifier state. The [user guide](user-guide.md#open-the-router-pane) describes each tab.
35
35
 
36
36
  | Reading | Meaning and limits |
37
- | ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
37
+ | ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
38
38
  | Next turn | The tier meter, the requested model and effort, and, under an activity override, the tier's own route. `! served by … · native fallback` appears only when the engine answered with another model. Actual effort is not reported. |
39
39
  | Classifier support | Per-tier probabilities from the last classification, on each pin; beside **why**, the support for the switch against the bar the policy required, and the switch cost. Pins and skipped calls leave it empty. |
40
40
  | Activity | The classifier's activity choice with its share and the next-best answer, on the Next turn line; `uncertain` shown dim. Empty with routing off, a pin, or no answer. |
41
41
  | Plan (Now) | Claude Code's 5-hour and 7-day plan windows with their reset times, on a Claude plan only. A reset time that has passed is not shown. |
42
- | Session (Now) | This session's total, main thread and subagents, labelled by how it is paid (`≈ API value` on a plan, `billed` otherwise), its difference against no routing and what no routing would cost, the main thread and the subagents as bars, and every main-conversation reply as a strip colored by tier, pairs of cells merging past 48 cells or on a narrow pane. The two-row band and `/router` show the same numbers. |
42
+ | Session (Now) | This session's total, main thread and subagents, labelled `API estimate` with `≈` for every billing product (configured rates, not an invoice or measured quota use), its difference against no routing and what no routing would cost, the main thread and the subagents as bars, and every main-conversation reply as a strip colored by tier, pairs of cells merging past 48 cells or on a narrow pane. The two-row band and `/router` show the same numbers. |
43
43
  | Routing vs no routing (Usage) | For a period (this session, today, 7 or 30 days, this month, or all), one table that adds up: the main thread against the same tokens on your model, the model `/model` selected at the session effort when each reply ran, with its cheaper-model saving, stronger-model cost and cache rebuilds; the subagents against Claude Code's picks; the total against no routing. The running turn's replies are included. `early sample` below 10 replies. Output length is held the same; answer quality is not measured. |
44
44
  | Breakdown (Usage) | The period's replies, cost and difference against no routing by activity, model or tier, each row opening to its routes or activities; the cost per hour, day or week, or **What if**, the same tokens on each model alone; from 20 replies, the cells worth a look, linked to Routes or Policy. |
45
45
  | Across sessions (Classifier) | The counts kept since the last reset: labelled turns, tool agreement on the classifier's raw answer, overall and for `code`, `ops` and `explore`, the two largest mismatches, activity moves inside a tier taken and refused, and escalations after a cheaper activity move. The active classifier's p95 latency shows on its **Deadline** line. `/router` text shows the agreement. |
package/docs/providers.md CHANGED
@@ -317,7 +317,7 @@ Launch on the model you would otherwise use:
317
317
  A launch model must be a model that some route runs. On any other model, a fresh session starts with routing off.
318
318
  To start on another Claude model, such as Sonnet, add it to `models`, put it on a route, and map it in the proxy configuration.
319
319
 
320
- Opus is billed by the plan and DeepSeek in credits, but the pane prices both at list prices, so one sum compares them: `session ≈$24.10 API value billed $4.10 −$45.90 (−66%) vs Opus 5.5`, where `billed $4.10` is the DeepSeek part.
320
+ Opus uses the plan and DeepSeek uses credits, but the pane estimates both at configured API rates (list/custom): `session ≈$24.10 API estimate credits ≈$4.10 −$45.90 (−66%) vs Opus 5.5`. The credits subtotal is a configured-rate estimate, not an invoice or attested gateway charge.
321
321
  See [how dollars are paid](user-guide.md#how-dollars-are-paid).
322
322
 
323
323
  Open `/router` and check the selected file, classifier health and routing state before use.
@@ -25,7 +25,7 @@
25
25
  <text x="765.0" y="56" fill="#87d787" xml:space="preserve">100%</text>
26
26
  <text x="796.2" y="56" fill="#7c7c7c" xml:space="preserve"> last</text>
27
27
  <text x="850.8" y="56" fill="#d0d0d0" xml:space="preserve">Router</text>
28
- <text class="cap" x="20" y="95">Two rows on a Claude plan, with the hover row shown: plan windows, the session as API value against your model, pins</text>
28
+ <text class="cap" x="20" y="95">Two rows on a Claude plan, with the hover row shown: plan windows, the session as a configured-rate API estimate against your model, pins</text>
29
29
  <rect x="12" y="103" width="897.6" height="67" rx="5" fill="#232323"/>
30
30
  <text x="24.0" y="121" fill="#e0708a" xml:space="preserve">▂</text>
31
31
  <text x="31.8" y="121" fill="#e0708a" xml:space="preserve">▄</text>
@@ -52,10 +52,10 @@
52
52
  <text x="281.4" y="140" fill="#87d787" xml:space="preserve">43%</text>
53
53
  <text x="328.2" y="140" fill="#7c7c7c" xml:space="preserve">session </text>
54
54
  <text x="390.6" y="140" fill="#d0d0d0" font-weight="700" xml:space="preserve">≈$6.40</text>
55
- <text x="437.4" y="140" fill="#7c7c7c" xml:space="preserve"> API value</text>
56
- <text x="538.8" y="140" fill="#6fcf97" font-weight="700" xml:space="preserve">−$1.84 (−22%)</text>
57
- <text x="640.2" y="140" fill="#7c7c7c" xml:space="preserve"> vs Opus 5.5</text>
58
- <text x="757.2" y="140" fill="#7c7c7c" xml:space="preserve">64 replies</text>
55
+ <text x="437.4" y="140" fill="#7c7c7c" xml:space="preserve"> API estimate</text>
56
+ <text x="562.2" y="140" fill="#6fcf97" font-weight="700" xml:space="preserve">−$1.84 (−22%)</text>
57
+ <text x="663.6" y="140" fill="#7c7c7c" xml:space="preserve"> vs Opus 5.5</text>
58
+ <text x="780.6" y="140" fill="#7c7c7c" xml:space="preserve">64 replies</text>
59
59
  <text x="24.0" y="159" fill="#7c7c7c" xml:space="preserve">pin </text>
60
60
  <rect x="55.2" y="145" width="140.4" height="18" rx="4" fill="#2e3340"/>
61
61
  <text x="55.2" y="159" fill="#d0d0d0" xml:space="preserve">[ ▂ Haiku·medium ]</text>
@@ -69,7 +69,7 @@
69
69
  <text x="663.6" y="159" fill="#d0d0d0" xml:space="preserve">[ Turn off ]</text>
70
70
  <rect x="772.8" y="145" width="70.2" height="18" rx="4" fill="#2e3340"/>
71
71
  <text x="772.8" y="159" fill="#d0d0d0" xml:space="preserve">[ 1 row ]</text>
72
- <text class="cap" x="20" y="198">Two rows on an API key: the session as billed against your model</text>
72
+ <text class="cap" x="20" y="198">Two rows on an API key: the session as a configured-rate API estimate, not an invoice, against your model</text>
73
73
  <rect x="12" y="206" width="897.6" height="48" rx="5" fill="#232323"/>
74
74
  <text x="24.0" y="224" fill="#e0708a" xml:space="preserve">▂</text>
75
75
  <text x="31.8" y="224" fill="#e0708a" xml:space="preserve">▄</text>
@@ -88,11 +88,11 @@
88
88
  <text x="796.2" y="224" fill="#7c7c7c" xml:space="preserve"> last</text>
89
89
  <text x="850.8" y="224" fill="#d0d0d0" xml:space="preserve">Router</text>
90
90
  <text x="24.0" y="243" fill="#7c7c7c" xml:space="preserve">session </text>
91
- <text x="86.4" y="243" fill="#d0d0d0" font-weight="700" xml:space="preserve">$6.40</text>
92
- <text x="125.4" y="243" fill="#7c7c7c" xml:space="preserve"> billed</text>
93
- <text x="203.4" y="243" fill="#6fcf97" font-weight="700" xml:space="preserve">−$1.84 (−22%)</text>
94
- <text x="304.8" y="243" fill="#7c7c7c" xml:space="preserve"> vs Opus 5.5</text>
95
- <text x="421.8" y="243" fill="#7c7c7c" xml:space="preserve">64 replies</text>
91
+ <text x="86.4" y="243" fill="#d0d0d0" font-weight="700" xml:space="preserve">≈$6.40</text>
92
+ <text x="133.2" y="243" fill="#7c7c7c" xml:space="preserve"> API estimate</text>
93
+ <text x="258.0" y="243" fill="#6fcf97" font-weight="700" xml:space="preserve">−$1.84 (−22%)</text>
94
+ <text x="359.4" y="243" fill="#7c7c7c" xml:space="preserve"> vs Opus 5.5</text>
95
+ <text x="476.4" y="243" fill="#7c7c7c" xml:space="preserve">64 replies</text>
96
96
  <text class="cap" x="20" y="282">A pin waits for the next turn; ✕ cancels it</text>
97
97
  <rect x="12" y="290" width="897.6" height="29" rx="5" fill="#232323"/>
98
98
  <text x="24.0" y="308" fill="#5f9fe0" xml:space="preserve">▂</text>
@@ -1,6 +1,6 @@
1
1
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 602 496" role="img" aria-labelledby="title desc">
2
2
  <title id="title">Router pane, Now tab</title>
3
- <desc id="desc">NEXT TURN: the tier meter, model and activity, the reason with the classifier support it weighed and the switch cost, and one pin per tier, low to high, with its support. PLAN: the 5-hour and 7-day windows with their resets. SESSION: the total of the main thread and one running subagent as API value, the difference against unrouted, the main thread and the subagents as bars on one scale, and a strip of every reply colored by tier with the replies per tier. CONTEXT: the window fill and the cache reuse.</desc>
3
+ <desc id="desc">NEXT TURN: the tier meter, model and activity, the reason with the classifier support it weighed and the switch cost, and one pin per tier, low to high, with its support. PLAN: the 5-hour and 7-day windows with their resets. SESSION: the total of the main thread and one running subagent as a configured-rate API estimate, the difference against unrouted, the main thread and the subagents as bars on one scale, and a strip of every reply colored by tier with the replies per tier. CONTEXT: the window fill and the cache reuse.</desc>
4
4
  <style>
5
5
  text { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13px; }
6
6
  .cap { font-family: system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: 12px; fill: #9a988f; }
@@ -59,9 +59,9 @@
59
59
  <text x="78.6" y="281" fill="#7c7c7c" xml:space="preserve"> since 14:18 · 86 replies · 6 agents · 9 switches</text>
60
60
  <text x="468.6" y="281" fill="#d7af5f" xml:space="preserve"> ● 1 running</text>
61
61
  <text x="39.6" y="300" fill="#d0d0d0" font-weight="700" xml:space="preserve">≈$8.97</text>
62
- <text x="86.4" y="300" fill="#7c7c7c" xml:space="preserve"> API value · plan quota, not billed </text>
63
- <rect x="382.8" y="286" width="70.2" height="18" rx="4" fill="#2e3340"/>
64
- <text x="382.8" y="300" fill="#d0d0d0" xml:space="preserve">[ Usage ]</text>
62
+ <text x="86.4" y="300" fill="#7c7c7c" xml:space="preserve"> API estimate · plan quota, not a charge </text>
63
+ <rect x="421.8" y="286" width="70.2" height="18" rx="4" fill="#2e3340"/>
64
+ <text x="421.8" y="300" fill="#d0d0d0" xml:space="preserve">[ Usage ]</text>
65
65
  <text x="39.6" y="319" fill="#6fcf97" font-weight="700" xml:space="preserve">−$4.09 (−31%)</text>
66
66
  <text x="141.0" y="319" fill="#d0d0d0" xml:space="preserve"> vs unrouted</text>
67
67
  <text x="234.6" y="319" fill="#7c7c7c" xml:space="preserve"> ≈$13.06</text>
@@ -1,12 +1,12 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 649 1085" role="img" aria-labelledby="title desc">
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 649 1104" role="img" aria-labelledby="title desc">
2
2
  <title id="title">Router pane, Usage tab, What if</title>
3
3
  <desc id="desc">This session by tier, with What if: the same tokens on Haiku 5.5, Sonnet 5.5 and Opus 5.5 alone against what routing spent.</desc>
4
4
  <style>
5
5
  text { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13px; }
6
6
  .cap { font-family: system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: 12px; fill: #9a988f; }
7
7
  </style>
8
- <rect width="649" height="1085" rx="8" fill="#1c1c1c"/>
9
- <rect x="10" y="10" width="629" height="1065" rx="6" fill="none" stroke="#3f5f8f"/>
8
+ <rect width="649" height="1104" rx="8" fill="#1c1c1c"/>
9
+ <rect x="10" y="10" width="629" height="1084" rx="6" fill="none" stroke="#3f5f8f"/>
10
10
  <text x="24.0" y="34" fill="#5fafd7" font-weight="700" xml:space="preserve">ROUTER</text>
11
11
  <rect x="86.4" y="20" width="62.4" height="18" rx="4" fill="#87afff"/>
12
12
  <text x="86.4" y="34" fill="#0d1016" font-weight="700" xml:space="preserve">[ ◉ on ]</text>
@@ -59,7 +59,7 @@
59
59
  <text x="289.2" y="262" fill="#f0b429" xml:space="preserve"> +$0.08</text>
60
60
  <text x="406.2" y="262" fill="#7c7c7c" xml:space="preserve"> ≈$2.44</text>
61
61
  <text x="24.0" y="281" fill="#7c7c7c" xml:space="preserve">─────────────────────────────────────────────────────────────</text>
62
- <text x="24.0" y="300" fill="#d0d0d0" font-weight="700" xml:space="preserve">session · ≈ API value</text>
62
+ <text x="24.0" y="300" fill="#d0d0d0" font-weight="700" xml:space="preserve">session · API estimate</text>
63
63
  <text x="226.8" y="300" fill="#d0d0d0" font-weight="700" xml:space="preserve"> ≈$8.97</text>
64
64
  <text x="289.2" y="300" fill="#6fcf97" font-weight="700" xml:space="preserve"> −$4.09</text>
65
65
  <text x="406.2" y="300" fill="#7c7c7c" xml:space="preserve"> ≈$13.06</text>
@@ -163,9 +163,10 @@
163
163
  <text x="320.4" y="908" fill="#d0d0d0" xml:space="preserve"> ≈$0.33</text>
164
164
  <text x="390.6" y="908" fill="#7c7c7c" xml:space="preserve"> your model</text>
165
165
  <text x="24.0" y="946" fill="#7c7c7c" xml:space="preserve"> ■ moved by the router · □ Claude Code’s pick · color: the model</text>
166
- <text x="24.0" y="965" fill="#7c7c7c" xml:space="preserve"> vs CC: the same tokens on Claude Code’s pick, at list prices</text>
167
- <text x="24.0" y="1003" fill="#7c7c7c" xml:space="preserve"> $ = tokens × list prices · ≈ = API value of plan quota</text>
168
- <text x="24.0" y="1022" fill="#7c7c7c" xml:space="preserve"> answer quality not measured</text>
169
- <rect x="24.0" y="1046" width="140.4" height="18" rx="4" fill="#2e3340"/>
170
- <text x="24.0" y="1060" fill="#7c7c7c" xml:space="preserve">[ Delete history ]</text>
166
+ <text x="24.0" y="965" fill="#7c7c7c" xml:space="preserve"> vs CC: the same tokens on Claude Code’s pick, at configured API rates</text>
167
+ <text x="24.0" y="1003" fill="#7c7c7c" xml:space="preserve"> ≈$ = tokens × configured API rates (list/custom)</text>
168
+ <text x="24.0" y="1022" fill="#7c7c7c" xml:space="preserve"> not invoices or measured quota savings</text>
169
+ <text x="24.0" y="1041" fill="#7c7c7c" xml:space="preserve"> answer quality not measured</text>
170
+ <rect x="24.0" y="1065" width="140.4" height="18" rx="4" fill="#2e3340"/>
171
+ <text x="24.0" y="1079" fill="#7c7c7c" xml:space="preserve">[ Delete history ]</text>
171
172
  </svg>
@@ -1,12 +1,12 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 758 1123" role="img" aria-labelledby="title desc">
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 758 1142" role="img" aria-labelledby="title desc">
2
2
  <title id="title">Router pane, Usage tab</title>
3
3
  <desc id="desc">The last 7 days across sessions: the period row, the difference against unrouted first, then a cost table whose rows add up (the main thread with its cheaper-model saving and cache rebuilds, the subagents, the total) with each row against unrouted, the replies and tokens, the cost by activity with code opened to its routes and cost parts, the cost by day, what is worth a look with a link to Routes, subagents, and Delete history.</desc>
4
4
  <style>
5
5
  text { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace; font-size: 13px; }
6
6
  .cap { font-family: system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: 12px; fill: #9a988f; }
7
7
  </style>
8
- <rect width="758" height="1123" rx="8" fill="#1c1c1c"/>
9
- <rect x="10" y="10" width="738" height="1103" rx="6" fill="none" stroke="#3f5f8f"/>
8
+ <rect width="758" height="1142" rx="8" fill="#1c1c1c"/>
9
+ <rect x="10" y="10" width="738" height="1122" rx="6" fill="none" stroke="#3f5f8f"/>
10
10
  <text x="24.0" y="34" fill="#5fafd7" font-weight="700" xml:space="preserve">ROUTER</text>
11
11
  <rect x="86.4" y="20" width="62.4" height="18" rx="4" fill="#87afff"/>
12
12
  <text x="86.4" y="34" fill="#0d1016" font-weight="700" xml:space="preserve">[ ◉ on ]</text>
@@ -58,7 +58,7 @@
58
58
  <text x="289.2" y="262" fill="#6fcf97" xml:space="preserve"> −$0.51</text>
59
59
  <text x="406.2" y="262" fill="#7c7c7c" xml:space="preserve"> ≈$6.11</text>
60
60
  <text x="24.0" y="281" fill="#7c7c7c" xml:space="preserve">─────────────────────────────────────────────────────────────</text>
61
- <text x="24.0" y="300" fill="#d0d0d0" font-weight="700" xml:space="preserve">7 days · ≈ API value</text>
61
+ <text x="24.0" y="300" fill="#d0d0d0" font-weight="700" xml:space="preserve">7 days · API estimate</text>
62
62
  <text x="226.8" y="300" fill="#d0d0d0" font-weight="700" xml:space="preserve"> ≈$20.93</text>
63
63
  <text x="289.2" y="300" fill="#6fcf97" font-weight="700" xml:space="preserve"> −$12.29</text>
64
64
  <text x="406.2" y="300" fill="#7c7c7c" xml:space="preserve"> ≈$33.22</text>
@@ -180,9 +180,10 @@
180
180
  <text x="320.4" y="946" fill="#d0d0d0" xml:space="preserve"> ≈$0.12</text>
181
181
  <text x="390.6" y="946" fill="#7c7c7c" xml:space="preserve"> its agent file sets it</text>
182
182
  <text x="24.0" y="984" fill="#7c7c7c" xml:space="preserve"> ■ moved by the router · □ Claude Code’s pick · color: the model</text>
183
- <text x="24.0" y="1003" fill="#7c7c7c" xml:space="preserve"> vs CC: the same tokens on Claude Code’s pick, at list prices</text>
184
- <text x="24.0" y="1041" fill="#7c7c7c" xml:space="preserve"> $ = tokens × list prices · ≈ = API value of plan quota</text>
185
- <text x="24.0" y="1060" fill="#7c7c7c" xml:space="preserve"> answer quality not measured</text>
186
- <rect x="24.0" y="1084" width="140.4" height="18" rx="4" fill="#2e3340"/>
187
- <text x="24.0" y="1098" fill="#7c7c7c" xml:space="preserve">[ Delete history ]</text>
183
+ <text x="24.0" y="1003" fill="#7c7c7c" xml:space="preserve"> vs CC: the same tokens on Claude Code’s pick, at configured API rates</text>
184
+ <text x="24.0" y="1041" fill="#7c7c7c" xml:space="preserve"> ≈$ = tokens × configured API rates (list/custom)</text>
185
+ <text x="24.0" y="1060" fill="#7c7c7c" xml:space="preserve"> not invoices or measured quota savings</text>
186
+ <text x="24.0" y="1079" fill="#7c7c7c" xml:space="preserve"> answer quality not measured</text>
187
+ <rect x="24.0" y="1103" width="140.4" height="18" rx="4" fill="#2e3340"/>
188
+ <text x="24.0" y="1117" fill="#7c7c7c" xml:space="preserve">[ Delete history ]</text>
188
189
  </svg>
@@ -3,11 +3,11 @@
3
3
  One setting trades cost against answer quality: `cost`, `balanced` (the default) or `quality`. The classifier and
4
4
  your routes stay as they are. The mode moves the route each tier runs by one fixed step.
5
5
 
6
- | Mode | What changes |
7
- | --- | --- |
8
- | `cost` | A cheaper route where the turn allows it: the tier below when that tier runs a model with a lower input price (at `low`, the `low` route without its activity override), else one effort level less on the same model. `high` keeps its model and drops one effort level. Never below `low`. |
9
- | `balanced` | Nothing: every tier runs its route as configured. |
10
- | `quality` | One effort level more on the same model, else the route of the tier above. |
6
+ | Mode | What changes |
7
+ | ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
8
+ | `cost` | A cheaper route where the turn allows it: the tier below when that tier runs a model with a lower input price (at `low`, the `low` route without its activity override), else one effort level less on the same model. `high` keeps its model and drops one effort level. Never below `low`. |
9
+ | `balanced` | Nothing: every tier runs its route as configured. |
10
+ | `quality` | One effort level more on the same model, else the route of the tier above. Haiku 5.5 automatically prefers High, except medium bounded ops may use Xhigh. Explicit higher efforts stay supported. |
11
11
 
12
12
  In every mode:
13
13
 
@@ -73,7 +73,9 @@ keys are allowed, and the result must pass the same checks as `policy`.
73
73
  ## Every decision
74
74
 
75
75
  The route each mode gives a session's first turn, for each classifier answer, through the router's real decision
76
- path. Generated from the test data by `npm run docs:modes`; `test/mode-matrix.test.mjs` fails when it is stale.
76
+ path. Here `ops` means an accepted bounded `execute` phase; `ops + reason` instead uses the same-tier `debug` row,
77
+ and `ops + produce` uses `code`. Unclear/report phases do not introduce a new ops discount (see [Activity routing](activity-routing.md)).
78
+ Generated from the test data by `npm run docs:modes`; `test/mode-matrix.test.mjs` fails when it is stale.
77
79
 
78
80
  <!-- mode-matrix:start -->
79
81
  **Built-in routes**
@@ -82,13 +84,13 @@ path. Generated from the test data by `npm run docs:modes`; `test/mode-matrix.te
82
84
  | --- | --- | --- | --- | --- |
83
85
  | micro | code, debug, explore, plan, review, ops, docs, uncertain | Haiku · medium | Haiku · medium | Haiku · medium |
84
86
  | low | code, debug, plan, review | Haiku · high | Sonnet · high | Sonnet · xhigh |
85
- | low | explore, ops, docs, uncertain | Haiku · medium | Haiku · high | Haiku · xhigh |
87
+ | low | explore, ops, docs, uncertain | Haiku · medium | Haiku · high | Haiku · high |
86
88
  | medium | code, debug, plan, review | Sonnet · high | Opus · medium | Opus · high |
87
89
  | medium | explore, docs, uncertain | Haiku · high | Opus · medium | Opus · high |
88
90
  | medium | ops | Haiku · medium | Haiku · high | Haiku · xhigh |
89
91
  | high | code, debug, explore, plan, review, ops, docs, uncertain | Opus · high | Opus · xhigh | Opus · max |
90
92
  | uncertain | code, debug, plan, review | Haiku · high | Sonnet · high | Sonnet · xhigh |
91
- | uncertain | explore, ops, docs, uncertain | Haiku · medium | Haiku · high | Haiku · xhigh |
93
+ | uncertain | explore, ops, docs, uncertain | Haiku · medium | Haiku · high | Haiku · high |
92
94
 
93
95
  **`routes.high` = Opus · high**
94
96
 
@@ -96,18 +98,18 @@ path. Generated from the test data by `npm run docs:modes`; `test/mode-matrix.te
96
98
  | --- | --- | --- | --- | --- |
97
99
  | micro | code, debug, explore, plan, review, ops, docs, uncertain | Haiku · medium | Haiku · medium | Haiku · medium |
98
100
  | low | code, debug, plan, review | Haiku · high | Sonnet · high | Sonnet · xhigh |
99
- | low | explore, ops, docs, uncertain | Haiku · medium | Haiku · high | Haiku · xhigh |
101
+ | low | explore, ops, docs, uncertain | Haiku · medium | Haiku · high | Haiku · high |
100
102
  | medium | code, debug, plan, review | Sonnet · high | Opus · medium | Opus · high |
101
103
  | medium | explore, docs, uncertain | Haiku · high | Opus · medium | Opus · high |
102
104
  | medium | ops | Haiku · medium | Haiku · high | Haiku · xhigh |
103
105
  | high | code, debug, explore, plan, review, ops, docs, uncertain | Opus · medium | Opus · high | Opus · xhigh |
104
106
  | uncertain | code, debug, plan, review | Haiku · high | Sonnet · high | Sonnet · xhigh |
105
- | uncertain | explore, ops, docs, uncertain | Haiku · medium | Haiku · high | Haiku · xhigh |
107
+ | uncertain | explore, ops, docs, uncertain | Haiku · medium | Haiku · high | Haiku · high |
106
108
  <!-- mode-matrix:end -->
107
109
 
108
110
  ## Known trade-offs
109
111
 
110
- The steps are fixed rules, with no per-activity exceptions. Before 1.21.1, `cost` ran `high` ops on Haiku 5.5 and `low`
112
+ The steps are fixed rules, with the Haiku 5.5 quality preference and its one medium bounded-ops exception. Before 1.21.1, `cost` ran `high` ops on Haiku 5.5 and `low`
111
113
  code on Sonnet 5.5 at medium, which scored below Haiku 5.5 at high on FrontierCode and costs more per token. One cell
112
114
  still goes against this router's own model notes (`lib/config.mjs`):
113
115