opencode-model-router 2.5.0 → 2.6.1
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.
- package/CHANGELOG.md +90 -0
- package/README.md +107 -38
- package/package.json +1 -1
- package/src/index.ts +3 -2
- package/src/router/config.ts +8 -0
- package/tiers.json +11 -96
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,96 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [2.6.1] - 2026-10-09
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- **OpenCode v1 no longer drops `agent.<tier>.permission` and `.tools` for `@medium` and `@heavy`.** The v1 `config`
|
|
15
|
+
hook replaced the user's `opencode.json` entry wholesale for every non-read-only tier except `fast`; it now keeps
|
|
16
|
+
the user's `permission` and `tools` for every non-read-only tier (#97). Output without user entries is unchanged,
|
|
17
|
+
and v2 was already correct.
|
|
18
|
+
|
|
19
|
+
## [2.6.0] - 2026-10-09
|
|
20
|
+
|
|
21
|
+
### Changed
|
|
22
|
+
|
|
23
|
+
- **Bundled `anthropic` preset values.** `@fast` is now `anthropic/claude-haiku-5-5` with variant/effort `medium`
|
|
24
|
+
(was `low`); `@medium` is now `anthropic/claude-sonnet-5-5` with variant/effort `high` (was `medium`). `@heavy` is
|
|
25
|
+
unchanged.
|
|
26
|
+
- **Bundled `hybrid` preset values.** `@fast` is now `anthropic/claude-haiku-5-5` with variant and effort `medium`
|
|
27
|
+
(was OpenAI `gpt-6-luna-fast`); `@medium` is now `openai/gpt-6.1-sol-fast` with variant `xhigh` and no `effort`
|
|
28
|
+
(was `gpt-6-astra-fast`). `@heavy` is unchanged.
|
|
29
|
+
- **A preset chosen with `/preset` that no layer defines is now reported.** The config load adds one notice,
|
|
30
|
+
`the preset '<name>' chosen with /preset is not defined (defined: …); using '<active>'`, and keeps routing on the
|
|
31
|
+
configured `activePreset` (OpenCode v1 and v2 alike, since both load the same config). An overrides file whose own
|
|
32
|
+
`activePreset` names an undefined preset still drops that whole layer, as before.
|
|
33
|
+
|
|
34
|
+
### Removed
|
|
35
|
+
|
|
36
|
+
- **Bundled presets `hybrid-2` and `fable-effort`.** The bundled presets are now `anthropic`, `openai`,
|
|
37
|
+
`github-copilot`, `google`, `hybrid` and `zai`.
|
|
38
|
+
|
|
39
|
+
**Migration.** If you use `hybrid-2` or `fable-effort`, or want the previous `hybrid` values back, copy that block
|
|
40
|
+
into `presets` in `opencode-model-router.overrides.jsonc` and keep `activePreset` pointing at it. The 2.5.0
|
|
41
|
+
`fable-effort` block:
|
|
42
|
+
|
|
43
|
+
```jsonc
|
|
44
|
+
{
|
|
45
|
+
"presets": {
|
|
46
|
+
"fable-effort": {
|
|
47
|
+
"fast": {
|
|
48
|
+
"readOnly": true,
|
|
49
|
+
"model": "anthropic/claude-fable-5-1",
|
|
50
|
+
"effort": "low",
|
|
51
|
+
"costRatio": 1,
|
|
52
|
+
"description": "Fable 5 at low effort for exploration, search, and simple reads (token-spend ratios are estimates; same model across tiers preserves prompt cache)",
|
|
53
|
+
"steps": 30,
|
|
54
|
+
"whenToUse": [
|
|
55
|
+
"Codebase exploration and search",
|
|
56
|
+
"Simple file reads and listing",
|
|
57
|
+
"Grep/glob operations",
|
|
58
|
+
"Quick lookups and research"
|
|
59
|
+
]
|
|
60
|
+
},
|
|
61
|
+
"medium": {
|
|
62
|
+
"model": "anthropic/claude-fable-5-1",
|
|
63
|
+
"effort": "high",
|
|
64
|
+
"costRatio": 3,
|
|
65
|
+
"description": "Fable 5 at high effort for implementation and standard coding (costRatio is an estimated token-spend multiplier, not a price difference)",
|
|
66
|
+
"steps": 50,
|
|
67
|
+
"whenToUse": [
|
|
68
|
+
"Feature implementation",
|
|
69
|
+
"Refactoring",
|
|
70
|
+
"Writing tests",
|
|
71
|
+
"Bug fixes"
|
|
72
|
+
]
|
|
73
|
+
},
|
|
74
|
+
"heavy": {
|
|
75
|
+
"model": "anthropic/claude-fable-5-1",
|
|
76
|
+
"effort": "xhigh",
|
|
77
|
+
"costRatio": 6,
|
|
78
|
+
"description": "Fable 5 at xhigh effort for architecture, complex debugging, and security (costRatio is an estimated token-spend multiplier, not a price difference)",
|
|
79
|
+
"steps": 120,
|
|
80
|
+
"whenToUse": [
|
|
81
|
+
"Architecture decisions",
|
|
82
|
+
"Complex debugging (after 2+ failures)",
|
|
83
|
+
"Security review",
|
|
84
|
+
"Performance optimization"
|
|
85
|
+
]
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
"activePreset": "fable-effort"
|
|
90
|
+
}
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
The 2.5.0 `hybrid-2` block and the previous `hybrid` block are in `git show v2.5.0:tiers.json` (or in the 2.5.0
|
|
94
|
+
package's `tiers.json`); copy a block under its own name. For the previous `hybrid`, use a new name (for example `hybrid-2-5-0`) and set`n `activePreset` to it: preset overrides merge key by key, so a block copied under `hybrid` would keep keys the new`n bundled tiers set and the old ones do not (the new `@fast` has `effort: "medium"`).
|
|
95
|
+
|
|
96
|
+
**Define the preset in the same file as `activePreset`.** An overrides file whose `activePreset` names a preset no
|
|
97
|
+
layer defines is dropped as a whole layer, so its other settings are lost too. A preset you last chose with
|
|
98
|
+
`/preset` and that is no longer defined only produces the notice above and routes on the configured `activePreset`.
|
|
99
|
+
|
|
10
100
|
## [2.5.0] - 2026-10-09
|
|
11
101
|
|
|
12
102
|
### Added
|
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> **Use the cheapest model that can do the job. Automatically.**
|
|
6
6
|
|
|
7
|
-
An [OpenCode](https://opencode.ai) plugin that routes every coding task to the right-priced AI tier — automatically, on every message, with 3,
|
|
7
|
+
An [OpenCode](https://opencode.ai) plugin that routes every coding task to the right-priced AI tier — automatically, on every message, with 3,249–6,357 characters of system-prompt overhead depending on the orchestrator and enforcement mode.
|
|
8
8
|
|
|
9
9
|
## Why it's different
|
|
10
10
|
|
|
@@ -24,7 +24,7 @@ Most AI coding tools give you one model for everything. You pay Opus prices to r
|
|
|
24
24
|
The orchestrator runs on *every* message. Put Sonnet there, not Opus. Sonnet reads a routing protocol and delegates just as well as Opus — at 4x lower cost. Reserve Opus for when it genuinely matters.
|
|
25
25
|
|
|
26
26
|
**Inject a compressed, LLM-optimized routing protocol.**
|
|
27
|
-
Instead of duplicated prose, the plugin injects a dense, machine-readable routing protocol. The protocol itself is 3,
|
|
27
|
+
Instead of duplicated prose, the plugin injects a dense, machine-readable routing protocol. The protocol itself is 3,249 characters; a Claude orchestrator receives 4,021 characters after its authority prefix (roughly 1,005–1,117 tokens at 3.6–4.0 characters per token). Every message, every session.
|
|
28
28
|
|
|
29
29
|
**Match task to tier using a configurable taxonomy.**
|
|
30
30
|
A keyword routing guide (`@fast→search/grep/read`, `@medium→impl/refactor/test`, `@heavy→arch/debug/security`) tells the orchestrator exactly which tier fits each task type. Fully customizable. No ambiguity.
|
|
@@ -45,7 +45,7 @@ Every tier carries its `costRatio` (fast=1x, medium=5x, heavy=20x) injected into
|
|
|
45
45
|
If the orchestrator is already running on Opus, the rule `self∈opus→never→@heavy` fires — it does the heavy work itself rather than delegating to another Opus instance.
|
|
46
46
|
|
|
47
47
|
**Multi-provider support with automatic fallback.**
|
|
48
|
-
|
|
48
|
+
Six presets out of the box: Anthropic, OpenAI, GitHub Copilot, Google, hybrid, and Zai (GLM). Switch with `/preset`. If a provider fails, the fallback chain tries the next one automatically.
|
|
49
49
|
|
|
50
50
|
**Plan annotation for long tasks.**
|
|
51
51
|
`/annotate-plan` reads a markdown plan and tags each step with `[tier:fast]`, `[tier:medium]`, or `[tier:heavy]` — removing all routing ambiguity from multi-step workflows.
|
|
@@ -77,7 +77,7 @@ opencode-model-router injects a **delegation protocol** into the system prompt t
|
|
|
77
77
|
4. **Never over-qualify** — use the cheapest tier that can reliably handle the task
|
|
78
78
|
5. **Fallback** across providers when one fails
|
|
79
79
|
|
|
80
|
-
All of this adds 3,
|
|
80
|
+
All of this adds 3,249 characters for a non-Claude orchestrator or 4,021 characters for a Claude orchestrator (roughly 812–1,117 tokens at 3.6–4.0 characters per token).
|
|
81
81
|
|
|
82
82
|
## Understanding how it works
|
|
83
83
|
|
|
@@ -178,7 +178,7 @@ Task distribution: 18 exploration (60%), 10 implementation (33%), 2 architecture
|
|
|
178
178
|
|
|
179
179
|
## How it works
|
|
180
180
|
|
|
181
|
-
On every message, the plugin injects a 3,
|
|
181
|
+
On every message, the plugin injects a 3,249-character routing protocol. A Claude orchestrator receives 4,021 characters after its authority prefix (roughly 1,005–1,117 tokens at 3.6–4.0 characters per token). The notation is intentionally dense and compressed — it's **optimized for LLM comprehension, not human readability**. An agent reads it as a precise routing grammar; a human might squint at it.
|
|
182
182
|
|
|
183
183
|
What the orchestrator sees (Anthropic preset, normal mode):
|
|
184
184
|
|
|
@@ -230,7 +230,7 @@ With router → split:
|
|
|
230
230
|
| Cross-provider fallback | ✅ | ❌ | ❌ | ❌ | ❌ |
|
|
231
231
|
| Cost ratio awareness | ✅ | ❌ | ❌ | ❌ | ❌ |
|
|
232
232
|
| Plan annotation with tiers | ✅ | ❌ | ❌ | ❌ | ❌ |
|
|
233
|
-
| Measured prompt overhead: 3,
|
|
233
|
+
| Measured prompt overhead: 3,249–6,357 chars | ✅ | — | ❌ | ❌ | ❌ |
|
|
234
234
|
|
|
235
235
|
**Claude native**: single model for everything, no cost routing. If you're using claude.ai or OpenCode without plugins, you're paying the same price for `grep` as for architecture design.
|
|
236
236
|
|
|
@@ -430,13 +430,13 @@ For an npm install, `tiers.json` is **inside the cached package directory**, not
|
|
|
430
430
|
|
|
431
431
|
### Presets
|
|
432
432
|
|
|
433
|
-
The plugin ships with
|
|
433
|
+
The plugin ships with six presets (switch with `/preset <name>`):
|
|
434
434
|
|
|
435
435
|
**anthropic** (default):
|
|
436
436
|
| Tier | Model | Cost ratio |
|
|
437
437
|
|------|-------|-----------|
|
|
438
|
-
| @fast | `anthropic/claude-haiku-5-5` (variant/effort:
|
|
439
|
-
| @medium | `anthropic/claude-sonnet-5-5` (variant/effort:
|
|
438
|
+
| @fast | `anthropic/claude-haiku-5-5` (variant/effort: medium) | 1x |
|
|
439
|
+
| @medium | `anthropic/claude-sonnet-5-5` (variant/effort: high) | 5x |
|
|
440
440
|
| @heavy | `anthropic/claude-opus-5-5` (variant/effort: xhigh) | 20x |
|
|
441
441
|
|
|
442
442
|
**openai**:
|
|
@@ -460,29 +460,22 @@ The plugin ships with eight presets (switch with `/preset <name>`):
|
|
|
460
460
|
| @medium | `google/gemini-3.7-flash` | 5x |
|
|
461
461
|
| @heavy | `google/gemini-3.1-pro-preview` | 20x |
|
|
462
462
|
|
|
463
|
-
**hybrid** —
|
|
463
|
+
**hybrid** — Anthropic for exploration and heavy analysis, OpenAI for implementation:
|
|
464
464
|
| Tier | Model | Cost ratio |
|
|
465
465
|
|------|-------|-----------|
|
|
466
|
-
| @fast | `
|
|
467
|
-
| @medium | `openai/gpt-6-
|
|
468
|
-
| @heavy | `anthropic/claude-opus-5-5` (variant/effort: xhigh) | 20x |
|
|
469
|
-
|
|
470
|
-
**hybrid-2** — OpenAI for exploration, Anthropic for implementation and heavy analysis:
|
|
471
|
-
| Tier | Model | Cost ratio |
|
|
472
|
-
|------|-------|-----------|
|
|
473
|
-
| @fast | `openai/gpt-6-luna-fast` (medium) | 1x |
|
|
474
|
-
| @medium | `anthropic/claude-sonnet-5-5` (variant/effort: xhigh) | 5x |
|
|
466
|
+
| @fast | `anthropic/claude-haiku-5-5` (variant/effort: medium) | 1x |
|
|
467
|
+
| @medium | `openai/gpt-6.1-sol-fast` (xhigh) | 5x |
|
|
475
468
|
| @heavy | `anthropic/claude-opus-5-5` (variant/effort: xhigh) | 20x |
|
|
476
469
|
|
|
477
|
-
**
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
470
|
+
> **Removed in 2.6.0:** the bundled `hybrid-2` and `fable-effort` presets, and the
|
|
471
|
+
> previous `hybrid` values (OpenAI `gpt-6-luna-fast` / `gpt-6-astra-fast` for `@fast` / `@medium`).
|
|
472
|
+
> To keep any of them, copy its block from the 2.5.0 `tiers.json` into `presets` in
|
|
473
|
+
> `opencode-model-router.overrides.jsonc` and keep `activePreset` there (the previous `hybrid` under a new name:
|
|
474
|
+
> preset overrides merge key by key). See the
|
|
475
|
+
> [changelog](CHANGELOG.md#260---2026-10-09) for the `fable-effort` block and the migration notes.
|
|
476
|
+
> A preset you chose with `/preset` that no layer defines any more is reported as a config notice
|
|
477
|
+
> (`the preset '<name>' chosen with /preset is not defined …`), and the router keeps routing on the
|
|
478
|
+
> configured `activePreset`.
|
|
486
479
|
|
|
487
480
|
**zai** — GLM through the Z.AI Coding Plan (the `zai-coding-plan` provider, which is where `glm-5.3` lives):
|
|
488
481
|
| Tier | Model | Variant | Cost ratio |
|
|
@@ -491,8 +484,8 @@ cache warm. The cost ratios are estimated token-spend multipliers, not price dif
|
|
|
491
484
|
| @medium | `zai-coding-plan/glm-5.3` | `high` | 3x |
|
|
492
485
|
| @heavy | `zai-coding-plan/glm-5.3` | `max` | 6x |
|
|
493
486
|
|
|
494
|
-
@medium and @heavy share one model, so
|
|
495
|
-
|
|
487
|
+
@medium and @heavy share one model, so the cost ratios are estimated token-spend
|
|
488
|
+
multipliers, not price differences.
|
|
496
489
|
|
|
497
490
|
### Per-tier `effort`
|
|
498
491
|
|
|
@@ -624,6 +617,82 @@ permissions: `readOnly: true` reuses the read-only policy, or give an explicit `
|
|
|
624
617
|
Project overrides cannot define `agents`. `opencode.json` wins for the fields it sets when it defines the same
|
|
625
618
|
name. `subagentTiers` no longer creates agents that do not exist (host built-ins such as `explore` still map). `allowTools` never grants edit, delegation, Code Mode or shell. See
|
|
626
619
|
[CONFIG_REFERENCE.md](docs/CONFIG_REFERENCE.md#agents--router-defined-subagents-81).
|
|
620
|
+
|
|
621
|
+
#### Focused helpers with an MCP allowlist
|
|
622
|
+
|
|
623
|
+
To give a subagent only the tools for one job, define it in the **global** overrides file,
|
|
624
|
+
`~/.config/opencode/opencode-model-router.overrides.jsonc`. Project overrides cannot define `agents`, on purpose:
|
|
625
|
+
a cloned repository must not be able to register agents with permissions.
|
|
626
|
+
|
|
627
|
+
```jsonc
|
|
628
|
+
{
|
|
629
|
+
"agents": {
|
|
630
|
+
"browser-tester": {
|
|
631
|
+
"tier": "fast",
|
|
632
|
+
"description": "Tests the app in a real browser with Playwright. Use for UI and end-to-end checks.",
|
|
633
|
+
"readOnly": true,
|
|
634
|
+
"allowTools": ["playwright_*"]
|
|
635
|
+
},
|
|
636
|
+
"docs-checker": {
|
|
637
|
+
"tier": "fast",
|
|
638
|
+
"description": "Looks up library docs and compares versions with Context7.",
|
|
639
|
+
"readOnly": true,
|
|
640
|
+
"allowTools": ["context7_*"]
|
|
641
|
+
},
|
|
642
|
+
"deep-thinker": {
|
|
643
|
+
"tier": "heavy",
|
|
644
|
+
"description": "Thinks through hard problems step by step before answering.",
|
|
645
|
+
"readOnly": true,
|
|
646
|
+
"allowTools": ["sequential-thinking_*"]
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
```
|
|
651
|
+
|
|
652
|
+
- `tier`: a tier of the active preset. The model follows the preset, so it changes with `/preset`.
|
|
653
|
+
- `description`: what the orchestrator reads to pick the helper. Be specific about the task and when to use it.
|
|
654
|
+
- `readOnly: true` or a `permission` block is required: a router agent never inherits the host's allow-all defaults.
|
|
655
|
+
- `allowTools`: extra tools allowed on top of that policy. MCP tools are named `<server>_<tool>`; use the server
|
|
656
|
+
names from your `opencode.json`. A wildcard is allowed only after a literal first character (`playwright_*`, not
|
|
657
|
+
`*_click`). `allowTools` cannot grant edit, shell, `read` or delegation; put those in `permission`.
|
|
658
|
+
|
|
659
|
+
Restart OpenCode after adding agents so they are registered. Reserved names (`fast`, `medium`, `heavy`, every
|
|
660
|
+
tier of the active preset) cannot be used as agent names.
|
|
661
|
+
|
|
662
|
+
#### Restricting the built-in tiers
|
|
663
|
+
|
|
664
|
+
`@medium` and `@heavy` otherwise see every installed tool, including MCP servers meant for a helper. Restrict them
|
|
665
|
+
with host permission rules in `opencode.json`. The router keeps these rules when it registers the tiers.
|
|
666
|
+
|
|
667
|
+
OpenCode 2:
|
|
668
|
+
|
|
669
|
+
```json
|
|
670
|
+
{
|
|
671
|
+
"agents": {
|
|
672
|
+
"heavy": {
|
|
673
|
+
"permissions": [
|
|
674
|
+
{ "action": "playwright_*", "resource": "*", "effect": "deny" }
|
|
675
|
+
]
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
```
|
|
680
|
+
|
|
681
|
+
OpenCode 1:
|
|
682
|
+
|
|
683
|
+
```json
|
|
684
|
+
{
|
|
685
|
+
"agent": {
|
|
686
|
+
"heavy": {
|
|
687
|
+
"permission": { "playwright_*": "deny" }
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
```
|
|
692
|
+
|
|
693
|
+
Prefer permission rules over the legacy `"tools": { "playwright_*": false }`, which is deprecated on OpenCode 1
|
|
694
|
+
and absent on OpenCode 2.
|
|
695
|
+
|
|
627
696
|
### Read-only call caps
|
|
628
697
|
|
|
629
698
|
Subagents carry a cap on their own read-only tool calls (grep/read/glob/ls) per dispatch. Enforcement is **two-layered**: prompt-level stop rules + runtime banners injected into tool results. Baselines (configurable via `tierCaps` — see below):
|
|
@@ -1021,13 +1090,13 @@ The bump applies to the optional `delegate` tool's automatic ladder, not native
|
|
|
1021
1090
|
`/bypass` leaves the ladder and effort bump active; use `effortBump: false` to disable
|
|
1022
1091
|
the bump.
|
|
1023
1092
|
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
still apply:
|
|
1029
|
-
|
|
1030
|
-
|
|
1093
|
+
**No bundled preset has a bumpable tier**: every tier that sets `effort` also sets a
|
|
1094
|
+
`variant`, and the rest omit `effort`. In particular, the default `anthropic` preset has
|
|
1095
|
+
no bumpable tier. The bump is for presets of your own that set `effort` without a
|
|
1096
|
+
`variant` (for example a one-model preset running at `low`, `high` and `xhigh`). Attempt
|
|
1097
|
+
and cost ceilings still apply: with the default cost multiple of 4, a ladder that
|
|
1098
|
+
starts at the cheapest tier may stop on cost before a later tier's bump is reached.
|
|
1099
|
+
Raise `enforcement.escalate.costCeiling.multiple` to allow it.
|
|
1031
1100
|
|
|
1032
1101
|
See the [configuration reference](docs/CONFIG_REFERENCE.md) for eligibility and
|
|
1033
1102
|
cost settings, and the [ADR](docs/adr/0004-delegation-depth-and-effort-bump.md) for
|
|
@@ -1227,7 +1296,7 @@ With the [routing engine](#cost-aware-routing-opt-in-opencode-v2) live on OpenCo
|
|
|
1227
1296
|
|
|
1228
1297
|
## Token overhead
|
|
1229
1298
|
|
|
1230
|
-
Measured with the bundled Anthropic preset in normal mode (the shipped `activePreset`/`activeMode` defaults), the routing protocol is 3,
|
|
1299
|
+
Measured with the bundled Anthropic preset in normal mode (the shipped `activePreset`/`activeMode` defaults), the routing protocol is 3,249 characters for a non-Claude orchestrator. A Claude orchestrator receives 4,021 characters after its authority prefix, or 6,357 characters when the 2,336-character DoD/enforcement section is enabled. That is roughly 812–1,766 tokens across the three paths at 3.6–4.0 characters per token. The optional anti-narration clause adds another 650 characters to the Claude path.
|
|
1231
1300
|
|
|
1232
1301
|
These are character counts of the prompts the shipped config actually produces, so they move whenever the protocol text does. `test/unit/docs-drift.test.ts` recomputes all three from `tiers.json` on every run and fails unless this section still quotes them, so a change that grows the protocol cannot land without updating these numbers.
|
|
1233
1302
|
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -2781,8 +2781,9 @@ const ModelRouterPlugin: Plugin = async (ctx: RouterPluginInput) => {
|
|
|
2781
2781
|
&& opencodeConfig.mcp.context7.enabled !== false), opencodeConfig.agent[name]?.permission);
|
|
2782
2782
|
agentDef.permission = permission;
|
|
2783
2783
|
agentDef.tools = { ...legacyReadOnlyTools(permission), ...opencodeConfig.agent[name]?.tools };
|
|
2784
|
-
} else
|
|
2785
|
-
// Opt-out removes OUR policy, not restrictions the user supplied
|
|
2784
|
+
} else {
|
|
2785
|
+
// Opt-out removes OUR policy, not restrictions the user supplied; they are kept
|
|
2786
|
+
// for every non-read-only tier, not just fast (#97).
|
|
2786
2787
|
for (const key of ["permission", "tools"]) {
|
|
2787
2788
|
if (opencodeConfig.agent[name]?.[key] !== undefined) agentDef[key] = opencodeConfig.agent[name][key];
|
|
2788
2789
|
}
|
package/src/router/config.ts
CHANGED
|
@@ -2726,6 +2726,14 @@ function buildConfig(
|
|
|
2726
2726
|
const resolved = resolvePresetName(cfg, state.activePreset);
|
|
2727
2727
|
if (resolved) {
|
|
2728
2728
|
cfg.activePreset = resolved;
|
|
2729
|
+
} else {
|
|
2730
|
+
// A preset saved by `/preset` that no layer defines any more (2.6.0 removed the bundled
|
|
2731
|
+
// `hybrid-2` and `fable-effort`). The config still loads on the configured activePreset,
|
|
2732
|
+
// but saying so beats routing quietly on a different preset.
|
|
2733
|
+
notices.push({
|
|
2734
|
+
source: statePath(),
|
|
2735
|
+
message: `the preset '${state.activePreset}' chosen with /preset is not defined (defined: ${Object.keys(cfg.presets).join(", ")}); using '${cfg.activePreset}'`,
|
|
2736
|
+
});
|
|
2729
2737
|
}
|
|
2730
2738
|
}
|
|
2731
2739
|
if (state.activeMode && cfg.modes?.[state.activeMode]) {
|
package/tiers.json
CHANGED
|
@@ -47,10 +47,10 @@
|
|
|
47
47
|
"fast": {
|
|
48
48
|
"readOnly": true,
|
|
49
49
|
"model": "anthropic/claude-haiku-5-5",
|
|
50
|
-
"variant": "
|
|
51
|
-
"effort": "
|
|
50
|
+
"variant": "medium",
|
|
51
|
+
"effort": "medium",
|
|
52
52
|
"costRatio": 1,
|
|
53
|
-
"description": "Haiku 5.5
|
|
53
|
+
"description": "Haiku 5.5 medium for exploration, search, and simple reads",
|
|
54
54
|
"steps": 30,
|
|
55
55
|
"whenToUse": [
|
|
56
56
|
"Codebase exploration and search",
|
|
@@ -61,10 +61,10 @@
|
|
|
61
61
|
},
|
|
62
62
|
"medium": {
|
|
63
63
|
"model": "anthropic/claude-sonnet-5-5",
|
|
64
|
-
"variant": "
|
|
65
|
-
"effort": "
|
|
64
|
+
"variant": "high",
|
|
65
|
+
"effort": "high",
|
|
66
66
|
"costRatio": 5,
|
|
67
|
-
"description": "Sonnet 5.5
|
|
67
|
+
"description": "Sonnet 5.5 high for implementation, refactoring, and tests",
|
|
68
68
|
"steps": 50,
|
|
69
69
|
"whenToUse": [
|
|
70
70
|
"Feature implementation",
|
|
@@ -254,53 +254,11 @@
|
|
|
254
254
|
"hybrid": {
|
|
255
255
|
"fast": {
|
|
256
256
|
"readOnly": true,
|
|
257
|
-
"model": "
|
|
258
|
-
"variant": "medium",
|
|
259
|
-
"costRatio": 1,
|
|
260
|
-
"description": "GPT 6 Luna (medium) for exploration, search, and simple reads",
|
|
261
|
-
"steps": 30,
|
|
262
|
-
"whenToUse": [
|
|
263
|
-
"Codebase exploration and search",
|
|
264
|
-
"Simple file reads and listing",
|
|
265
|
-
"Grep/glob operations",
|
|
266
|
-
"Quick lookups and research"
|
|
267
|
-
]
|
|
268
|
-
},
|
|
269
|
-
"medium": {
|
|
270
|
-
"model": "openai/gpt-6-astra-fast",
|
|
271
|
-
"variant": "high",
|
|
272
|
-
"costRatio": 5,
|
|
273
|
-
"description": "GPT-6 Astra Fast (high) for implementation and standard coding",
|
|
274
|
-
"steps": 50,
|
|
275
|
-
"whenToUse": [
|
|
276
|
-
"Feature implementation",
|
|
277
|
-
"Refactoring",
|
|
278
|
-
"Writing tests",
|
|
279
|
-
"Bug fixes"
|
|
280
|
-
]
|
|
281
|
-
},
|
|
282
|
-
"heavy": {
|
|
283
|
-
"model": "anthropic/claude-opus-5-5",
|
|
284
|
-
"variant": "xhigh",
|
|
285
|
-
"effort": "xhigh",
|
|
286
|
-
"costRatio": 20,
|
|
287
|
-
"description": "Claude Opus 5.5 xhigh for architecture, complex debugging, and security",
|
|
288
|
-
"steps": 120,
|
|
289
|
-
"whenToUse": [
|
|
290
|
-
"Architecture decisions",
|
|
291
|
-
"Complex debugging (after 2+ failures)",
|
|
292
|
-
"Security review",
|
|
293
|
-
"Performance optimization"
|
|
294
|
-
]
|
|
295
|
-
}
|
|
296
|
-
},
|
|
297
|
-
"hybrid-2": {
|
|
298
|
-
"fast": {
|
|
299
|
-
"readOnly": true,
|
|
300
|
-
"model": "openai/gpt-6-luna-fast",
|
|
257
|
+
"model": "anthropic/claude-haiku-5-5",
|
|
301
258
|
"variant": "medium",
|
|
259
|
+
"effort": "medium",
|
|
302
260
|
"costRatio": 1,
|
|
303
|
-
"description": "
|
|
261
|
+
"description": "Haiku 5.5 medium for exploration, search, and simple reads",
|
|
304
262
|
"steps": 30,
|
|
305
263
|
"whenToUse": [
|
|
306
264
|
"Codebase exploration and search",
|
|
@@ -310,11 +268,10 @@
|
|
|
310
268
|
]
|
|
311
269
|
},
|
|
312
270
|
"medium": {
|
|
313
|
-
"model": "
|
|
271
|
+
"model": "openai/gpt-6.1-sol-fast",
|
|
314
272
|
"variant": "xhigh",
|
|
315
|
-
"effort": "xhigh",
|
|
316
273
|
"costRatio": 5,
|
|
317
|
-
"description": "
|
|
274
|
+
"description": "GPT-6.1 Sol Fast (xhigh) for implementation and standard coding",
|
|
318
275
|
"steps": 50,
|
|
319
276
|
"whenToUse": [
|
|
320
277
|
"Feature implementation",
|
|
@@ -337,48 +294,6 @@
|
|
|
337
294
|
"Performance optimization"
|
|
338
295
|
]
|
|
339
296
|
}
|
|
340
|
-
},
|
|
341
|
-
"fable-effort": {
|
|
342
|
-
"fast": {
|
|
343
|
-
"readOnly": true,
|
|
344
|
-
"model": "anthropic/claude-fable-5-1",
|
|
345
|
-
"effort": "low",
|
|
346
|
-
"costRatio": 1,
|
|
347
|
-
"description": "Fable 5 at low effort for exploration, search, and simple reads (token-spend ratios are estimates; same model across tiers preserves prompt cache)",
|
|
348
|
-
"steps": 30,
|
|
349
|
-
"whenToUse": [
|
|
350
|
-
"Codebase exploration and search",
|
|
351
|
-
"Simple file reads and listing",
|
|
352
|
-
"Grep/glob operations",
|
|
353
|
-
"Quick lookups and research"
|
|
354
|
-
]
|
|
355
|
-
},
|
|
356
|
-
"medium": {
|
|
357
|
-
"model": "anthropic/claude-fable-5-1",
|
|
358
|
-
"effort": "high",
|
|
359
|
-
"costRatio": 3,
|
|
360
|
-
"description": "Fable 5 at high effort for implementation and standard coding (costRatio is an estimated token-spend multiplier, not a price difference)",
|
|
361
|
-
"steps": 50,
|
|
362
|
-
"whenToUse": [
|
|
363
|
-
"Feature implementation",
|
|
364
|
-
"Refactoring",
|
|
365
|
-
"Writing tests",
|
|
366
|
-
"Bug fixes"
|
|
367
|
-
]
|
|
368
|
-
},
|
|
369
|
-
"heavy": {
|
|
370
|
-
"model": "anthropic/claude-fable-5-1",
|
|
371
|
-
"effort": "xhigh",
|
|
372
|
-
"costRatio": 6,
|
|
373
|
-
"description": "Fable 5 at xhigh effort for architecture, complex debugging, and security (costRatio is an estimated token-spend multiplier, not a price difference)",
|
|
374
|
-
"steps": 120,
|
|
375
|
-
"whenToUse": [
|
|
376
|
-
"Architecture decisions",
|
|
377
|
-
"Complex debugging (after 2+ failures)",
|
|
378
|
-
"Security review",
|
|
379
|
-
"Performance optimization"
|
|
380
|
-
]
|
|
381
|
-
}
|
|
382
297
|
}
|
|
383
298
|
},
|
|
384
299
|
"taskPatterns": {
|