From fa531a5a336ae9a57c58312dbd668a30d1ed0936 Mon Sep 17 00:00:00 2001 From: Madi <29486218+jadmadi@users.noreply.github.com> Date: Fri, 18 Sep 2026 08:42:35 +0300 Subject: [PATCH] fix: record the OpenCode 2.0.7 model-provider baseline OpenCode 2.0.7 removed the catalog domain. The runtime now exposes ctx.model and ctx.provider with transform(editor) callbacks, and the published @opencode/plugin types agree. Update the baseline, the probe recipe, the checker's HOLD message, and the context-limit bullet. --- AGENTS.md | 23 +++++++++++++---------- README.md | 2 +- runtime-baseline.json | 8 ++++---- script/check-runtime-api.go | 2 +- 4 files changed, 19 insertions(+), 16 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 4008f46..211faf7 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -48,17 +48,18 @@ go run script/check-runtime-api.go ``` - HOLD means the baseline still matches. Keep the plain `{ id, setup }` object - and `ctx.catalog`. Do not migrate to the docs. + and the domains the baseline names. - MIGRATE means the runtime or the published package moved. Re-probe with the steps below, then update the baseline and the plugins together. - UNKNOWN means the check could not reach the runtime or the registry. Do not treat it as HOLD. -Baseline as of 2026-09-14, OpenCode 2.0.3: +Baseline as of 2026-09-18, OpenCode 2.0.7: -- `ctx.catalog` carries the model and provider transforms. -- `ctx.model` and `ctx.provider` do not exist, in the runtime or in the - published `@opencode/plugin@2.0.3` types. +- `ctx.model` carries model reads and transforms, and `ctx.provider` carries + provider reads and transforms. Both take `transform(editor)` callbacks. +- `ctx.catalog` does not exist. Migrate `ctx.catalog.model.*` to + `ctx.model.*` and `ctx.catalog.provider.*` to `ctx.provider.*`. - `import { Plugin } from "@opencode/plugin"` does not resolve for local file plugins. The package is published, but nothing installs it next to a raw plugin file, and the server loader does not alias it. Only @@ -67,13 +68,15 @@ Baseline as of 2026-09-14, OpenCode 2.0.3: Probe recipe when the check says MIGRATE: 1. Drop a temporary plugin in `~/.config/opencode/plugins/` that writes - `typeof ctx.model`, `"provider" in ctx`, and `Object.keys(ctx.catalog)` to - a file. Touch it, read the file, then remove it. + `typeof ctx.catalog`, `typeof ctx.model`, `typeof ctx.provider`, and the + member keys of each domain to a file. Touch it, read the file, then remove + it. 2. Drop a directory plugin importing `{ Plugin } from "@opencode/plugin"` and see whether it loads. -3. Record the results in `runtime-baseline.json`. If the import resolves and - `ctx.model` exists, migrate the plugins to `Plugin.define` and the - model/provider domains, bump minor versions, tag, and release. +3. Record the results in `runtime-baseline.json`. Migrate the plugins to the + domains the runtime exposes. If the import resolves, also migrate to + `Plugin.define` and the model/provider domains. Bump versions, tag, and + release after the fixes land. Known stale text: some plugin AGENTS.md files say npm only publishes dev snapshots of `@opencode/plugin`. That is no longer true. Fix the line when diff --git a/README.md b/README.md index a1d3b7e..be294aa 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ https://opencode.ai/go?ref=N9H3ZEP22A commands that switch provider and model mid-session. The command set comes from a user JSON file, so anyone can add their own. - [context-limit](https://github.com/jadmadi/opencode-context-limit): a working - context budget per model. It lowers the model window through a catalog + context budget per model. It lowers the model window through a model transform, so compaction fires earlier. It can only lower a window. - [max-mode](https://github.com/jadmadi/opencode-max-mode): a `best_of_n` tool that runs 2 to 8 candidate answers in parallel and a judge picks the winner. diff --git a/runtime-baseline.json b/runtime-baseline.json index b9ba379..d424242 100644 --- a/runtime-baseline.json +++ b/runtime-baseline.json @@ -1,6 +1,6 @@ { - "runtime": "2.0.3", - "api": "catalog", - "checked": "2026-09-14", - "note": "ctx.catalog.model and ctx.catalog.provider carry the model transforms. ctx.model and ctx.provider do not exist. The import { Plugin } from \"@opencode/plugin\" does not resolve for local file plugins; only @opencode/plugin/tui is aliased, for CLI plugins." + "runtime": "2.0.7", + "api": "model-provider", + "checked": "2026-09-18", + "note": "ctx.model carries model reads and transforms; ctx.provider carries provider reads and transforms. Both use transform(editor) callbacks. ctx.catalog does not exist. The import { Plugin } from \"@opencode/plugin\" does not resolve for local file plugins; only @opencode/plugin/tui is aliased, for CLI plugins." } diff --git a/script/check-runtime-api.go b/script/check-runtime-api.go index 311e1f1..b1bb98c 100644 --- a/script/check-runtime-api.go +++ b/script/check-runtime-api.go @@ -188,5 +188,5 @@ func main() { fmt.Printf(" installed opencode: %s\n", installed) fmt.Printf(" npm @opencode/plugin: %s (%s API)\n", info.Version, api) fmt.Printf(" baseline: %s %s, checked %s\n", base.Runtime, base.API, base.Checked) - fmt.Println(" Keep the plain { id, setup } object and ctx.catalog. Do not migrate to the docs yet.") + fmt.Println(" Keep the plain { id, setup } object and the domains the baseline names.") }