Repository navigation
Releases
0.6.1: a defect in the router can no longer stop the editor
A defect in the router can no longer stop the editor
Version 0.6.0 could refuse every prompt, in every mode, until the plugin was removed by hand. This release fixes that, and adds the test layer whose absence let it happen while 801 tests passed.
Upgrade if you are on 0.6.0. That release is not safe to run.
What went wrong
Two defects compounded.
- The process-wide shared core adopted whatever object it found in
globalThis, with no version check. A new bundle could inherit a core built by an older release, whose ledger had noplanPoolSpent(), sopremiumState()threw on every prompt. routing.failCloseddefaulted totrue, so that internalTypeErrorbecame a refusal to serve the prompt. Manual mode and paused routing did not exempt it.
Neither alone was fatal. A stale core with fail-open would have logged a warning. A correct core with fail-closed would have been annoying but usable. Together they disabled the editor.
The contract now
A defect in this plugin degrades to "do not route", never to "do not work".
- Blocking is opt-in.
routing.failCloseddefaults tofalseand means one thing: what to do when this plugin cannot produce a decision. An internal defect now serves the prompt with the model already selected, exactly as if the plugin were not installed, and records the reason in warnings. - Quota safety is separate and unconditional. A provider configured for probing with no reading is still refused, because that is a spending decision about a provider the router cannot see, not a response to its own failure.
- Hooks cannot throw or hang. Verified against a real OpenCode process: the host does not catch a throwing hook (HTTP 500) and does not time out a hanging one. Protection has to come from the plugin, so every hook is wrapped in
containHook()and routing runs against a 10 second deadline, after which the prompt proceeds unrouted. - A failed setup installs no hook. It used to leave a "minimal fail-closed" hook that refused every message, turning a failed setup into a disabled editor.
- A foreign shared core is replaced, not adopted. The core is stamped with
SHARED_CORE_API.
Also fixed
- Routing only considers models the host can serve. The router offered the whole seed catalog as candidates and switched a fresh session onto
opencode-go/claude-haiku-5-5, which that machine did not have. Candidates are now the intersection with the host's own model list. An empty result means no route, not an unfiltered fallback, because the fallback is how the unservable model got chosen. - Model discovery is awaited on the first routing decision, closing the startup window in which routing could see an empty list.
Proof rather than assertion
The suite passed while the product was unusable, so unit tests were not enough. scripts/isolated-e2e.sh now runs a real OpenCode process in a throwaway HOME and asserts only that OpenCode still answers a prompt. It runs against a loopback model stub it starts itself, so it needs no credentials, spends nothing, and cannot be blocked by provider quota. A CI job runs it on every push.
Its stale-shared-core scenario reproduces the production failure at host level, planting a previous version's core before the bundle loads. On the 0.6.0 bundle it fails with HTTP 500. On this release it passes. The scenario is red on the old code, so it measures the defect that actually occurred.
Current state: 822 tests across 75 files, all 69 mutation properties caught, clean-room verification with an empty HOME, and 7 host-survival scenarios passing with 2 documented host limitations.
Upgrading
Install the new version and reload. Nothing about the old configuration needs to change; failClosed simply defaults to the safe value. If you had set routing.failClosed: true deliberately, it still works, but now it covers plugin faults only.
The full account, including the exact production log lines, is in docs/INCIDENT-2026-11-06-prompt-lockout.md.
0.6.0 — Automatic flagship escalation
Do not install this release. It was never published to npm, and it is not
safe to build from this tag. Version 0.6.0 could refuse every prompt, in every
mode including manual mode, until the plugin was removed by hand.Two defects compounded. It adopted a shared core inherited from an older
version, whose ledger had noplanPoolSpent(), androuting.failClosed
defaulted totrue, so that internalTypeErrorbecame a refusal to serve
any prompt. 0.4.0, the version before it, is self-consistent and does not hit
this; the failure needed the 0.4.0 to 0.6.0 upgrade path.0.6.1
fixes both defects and is on npm. Use that instead. The full account is in
docs/INCIDENT-2026-11-06-prompt-lockout.md.The notes below are preserved as they were published, as a record of what
0.6.0 claimed and what it actually did.
Tier-3 work escalates by itself, paid from the plan-model pool.
Added
- Automatic flagship escalation (
premium.mode: "auto", now the default):
a tier-3 task routes to the plan-model pool (Claude Sonnet 5.5, GPT-6.1 Sol)
without a per-task approval prompt while the pool has budget. When the pool
is spent, escalation degrades to an approval gate and the router serves the
task with the strongest ordinary model - a routing refusal never fails a
serviceable task. Tier-1 and tier-2 work always stays on the ordinary pool. - Plan-model pool ledger: monthly buckets tracking spend against the
OpenDesign plan-model allowance (Pro: $120/month), persisted across
restarts, separate from Design Plan credits and from other providers'
premium spend. The cap is read from the resolved plan catalog. - Per-kind capability evidence:
ModelRecord.capabilities(coding,
debugging, agentic, architecture) from named benchmarks with provenance,
moving expected success by at most 4 points - enough to break a close
ranking, never enough to overrule a gate. Unscored models stay neutral:
absent evidence is unknown, not zero. - Context probes (
scripts/probe-plan-model-context.py): end-to-end
800K-token verification with memorization sentinels and truncation checks.
Changed
- GPT-6.1 Sol is scored (intelligence 55, Artificial Analysis v5.0.1) and
auto-approved for tier-3 escalation along with Sonnet 5.5, both by owner
instruction 2026-11-06. DeepSeek's observed 39.5 is untouched. - Catalog context windows raised from measured (328K/400K) to probed-verified
800K for both flagships after passed end-to-end probes on 2026-11-06; the
advertised 1M is deliberately NOT claimed, and Sol's long-context surcharge
above 272K was confirmed by the billed amounts. - MiniMax M3.1 Flash is classified as a Design Plan model. The gateway serves
it both inside and outside the Design Plan group and OpenDesign has not
published which applies, so the conservative choice is made: treating an
ordinary tier-2 workhorse as a plan model keeps routine work from draining
the escalation pool. Before this, a tier-3 task could land on it as a
premium model that a tier-2 flag itself made eligible.
Fixed
- A partial settings file no longer produces a warning for every key it leaves
out. Absent and invalid are now distinct: a key you did not write takes its
default silently, while a key you did write with the wrong type still reports
the problem. Before this, a config that only setproviders.opendesign.plan
emitted around fifty warnings and hid the ones that mattered.
0.4.0: Self-healing routing and npm distribution
The router now recovers from a class of provider errors that used to end the turn.
What happened on a real session: Anthropic only accepts user and assistant message roles. Mid-session notices got rebuilt into the prompt as system roles, so every turn on a Claude model died with Invalid discriminator value. Expected 'user' | 'assistant' at messages.23.role.
Three changes:
- For Anthropic-protocol models, the router folds system entries after the first message into user messages before the request leaves. The error cannot happen anymore.
- A rejected request shape is its own failure class now. The host's retry is refused, so the same 400 does not burn several turns in a row.
- If a provider still rejects the request, the router holds the model back for five minutes, re-routes the task to the next best eligible model, and continues the turn with a single
[router]notice. One failover per prompt. The panel shows what was rejected and what took over.
npm
The routing core ships as @qadanm/opencode-smart-router, one self-contained file with no runtime dependencies:
{ "plugin": ["@qadanm/opencode-smart-router"] }The desktop panel, terminal commands, history import and first-run onboarding still come from the installer:
curl -fsSL https://raw.githubusercontent.com/qadanm/opencode-smart-router/main/install | bash759 tests across 63 files. MIT.