Repository navigation
v0.6.0
What's Changed
-
a92c5d5: Fixes subagent ladder resolution by reading OpenCode's local
models.jsoncache (with event-driven invalidation and an 8s live-fetch timeout), excluding-fast/-flex/-ultrafastservice-tier siblings, preventing newer expensive models from superseding cheaper same-family models, and appendingparent#lowas the top downgrade rung with semantic rung tiers. -
4bafa2b: Replaces Jev and OpenRouter with a native same-provider fallback evaluator via OpenCode V2's
experimental.generate.textAPI:- Adds
src/evaluate.tswith ladder-aware prompt building,Effect.SchemaJSON decoding, timeout handling, and verdict mapping. - Adds
evaluatoroption ('lowest' | 'none' | ModelRefor model spec string, defaulting to'lowest') and updates defaulttimeoutMs(3000) andconfidenceMin(0.6). - Removes
src/jev.ts,src/decide.ts, OpenRouter API key resolution, and the installer's OpenRouter auth notice.
- Adds
-
e8605f3: Adds parent-assisted subagent routing via OpenCode V2's keyed
session.instructionsAPI andtool.execute.beforeguardrails:- Adds
modeoption ('hybrid' | 'parent' | 'classifier', defaulting to'hybrid'). - Syncs capability-labeled downgrade ladders into root session instructions on
session.hook('prompt')with memoized updates andsession.deletedcache eviction. - Validates parent-chosen models on native
subagentand T3delegate_taskcalls, loggingparent_kept,parent_downgraded,pinned_model,parent_omitted, or stripping invalid models (invalid_parent_model) to fail open.
- Adds
-
9b6b719: Adds local SQLite telemetry (
@effect/sql-sqlite-bun) and an Effect-based outcome tracker for subagent routing runs:- Records routing decisions and post-execution outcome signals (
ok,thrash,error,interrupted,retried) in$XDG_DATA_HOME/opencode/subagent-router.db(default~/.local/share/opencode/subagent-router.db) via inline migrations and a scoped SQLite client. - Tracks active runs (
pending -> running -> settled) in an EffectRefwith child-session event correlation (session.created,session.step.ended,session.tool.failed,session.execution.interrupted), 120s retry detection, and a non-blocking boundedQueuedrained on scope close. - Adds
telemetry(defaulttrue) and optionaltelemetryPathrouter options, failing open if telemetry is disabled or database initialization fails.
- Records routing decisions and post-execution outcome signals (
-
238ca2e: Adds an opt-in vector-assisted escalation guard powered by pure-TypeScript Model2Vec embeddings and SQLite BLOB storage:
- Adds SQLite migration
0002_create_prompt_vectorsand repository queries (insertVector,findSettledVectors) storing L2-normalizedFloat32Arrayembeddings asBLOBs indexed by canonical model identity (resolveModelIdentity, matching across OpenRouter, OpenAI, Anthropic, and Claude Agent with a resolution-guarded provider-qualified fallback) and zero native dependencies. - Implements a hardened pure-TS Model2Vec engine (
src/telemetry/model2vec.ts) using@huggingface/tokenizers, Effect'sFetchHttpClientandStream, a verified model manifest pinned to immutable 40-character Hugging Face commit SHAs (minishlab/potion-base-2Mandminishlab/potion-base-8M), HTTPS-only host-allowlisted manual redirect handling, streaming byte-size caps, BunCryptoHasherSHA-256 verification on both downloads and cache reads, path-traversal containment, non-fatal0o600/0o700atomic cache writes, and bounds-checked Safetensors parsing. - Adds an offline zero-download
ngramfallback embedder (Bun.hash.murmur32v3), non-blocking single-flightDeferredinitialization (createEmbedderHandle), a separate bounded vector worker inmakeTelemetryTracker, and conservative confirmed-failure step-up escalation (shouldEscalate,stepUpTarget) gated behindoptions.vectors(default{ enabled: false, backend: 'model2vec', model: 'minishlab/potion-base-2M' }). - Integrates history-based escalation into
execute.beforefor both parent-chosen and fallback-evaluator downgrades across nativesubagentand T3delegate_task, logginghistory_escalatedand recordingdecisionSource: 'escalated'.
- Adds SQLite migration
-
d1583a4: Removes support for OpenCode V1