Skip to content

v0.6.0

Choose a tag to compare

@JacobNWolf JacobNWolf released this 29 Nov 02:11
· 5 commits to main since this release

What's Changed

  • a92c5d5: Fixes subagent ladder resolution by reading OpenCode's local models.json cache (with event-driven invalidation and an 8s live-fetch timeout), excluding -fast/-flex/-ultrafast service-tier siblings, preventing newer expensive models from superseding cheaper same-family models, and appending parent#low as 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.text API:

    • Adds src/evaluate.ts with ladder-aware prompt building, Effect.Schema JSON decoding, timeout handling, and verdict mapping.
    • Adds evaluator option ('lowest' | 'none' | ModelRef or model spec string, defaulting to 'lowest') and updates default timeoutMs (3000) and confidenceMin (0.6).
    • Removes src/jev.ts, src/decide.ts, OpenRouter API key resolution, and the installer's OpenRouter auth notice.
  • e8605f3: Adds parent-assisted subagent routing via OpenCode V2's keyed session.instructions API and tool.execute.before guardrails:

    • Adds mode option ('hybrid' | 'parent' | 'classifier', defaulting to 'hybrid').
    • Syncs capability-labeled downgrade ladders into root session instructions on session.hook('prompt') with memoized updates and session.deleted cache eviction.
    • Validates parent-chosen models on native subagent and T3 delegate_task calls, logging parent_kept, parent_downgraded, pinned_model, parent_omitted, or stripping invalid models (invalid_parent_model) to fail open.
  • 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 Effect Ref with child-session event correlation (session.created, session.step.ended, session.tool.failed, session.execution.interrupted), 120s retry detection, and a non-blocking bounded Queue drained on scope close.
    • Adds telemetry (default true) and optional telemetryPath router options, failing open if telemetry is disabled or database initialization fails.
  • 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_vectors and repository queries (insertVector, findSettledVectors) storing L2-normalized Float32Array embeddings as BLOBs 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's FetchHttpClient and Stream, a verified model manifest pinned to immutable 40-character Hugging Face commit SHAs (minishlab/potion-base-2M and minishlab/potion-base-8M), HTTPS-only host-allowlisted manual redirect handling, streaming byte-size caps, Bun CryptoHasher SHA-256 verification on both downloads and cache reads, path-traversal containment, non-fatal 0o600/0o700 atomic cache writes, and bounds-checked Safetensors parsing.
    • Adds an offline zero-download ngram fallback embedder (Bun.hash.murmur32v3), non-blocking single-flight Deferred initialization (createEmbedderHandle), a separate bounded vector worker in makeTelemetryTracker, and conservative confirmed-failure step-up escalation (shouldEscalate, stepUpTarget) gated behind options.vectors (default { enabled: false, backend: 'model2vec', model: 'minishlab/potion-base-2M' }).
    • Integrates history-based escalation into execute.before for both parent-chosen and fallback-evaluator downgrades across native subagent and T3 delegate_task, logging history_escalated and recording decisionSource: 'escalated'.
  • d1583a4: Removes support for OpenCode V1