Skip to content

OpenCode 2: validate .opencode config against the v2 schema and port the v1 plugins #730

Open

Description

@dezren39

Part of the fleet-wide OpenCode 2 migration tracked at developing-today-forks/opencode#374 (origin issue for the whole set).

Upstream migration guide: https://dev.opencode.ai/v2/docs/migrate-v1/

Two workstreams in this repo:

1. Config validation — .opencode/opencode.jsonc against OpenCode v2

  • Load the repo config with OpenCode v2 (@opencode/[email protected]) and record what it accepts and rejects.
  • Config files, agents, commands, and skills under .opencode/ are intended to be compatible; some v1 fields are accepted but ignored by v2. Hard rejections get fixed (PR); accepted-but-ignored fields get listed here so we can decide whether to keep them while runtimes are still migrating or drop them.
  • Note: .opencode/cli.json already targets the v2 CLI schema (https://opencode.ai/v2/cli.json), while .opencode/tui.jsonc still exists alongside it (v2 auto-migrates tui.json → cli.json).

2. Plugin ports — v1 plugin API → v2 plugin API

v1 plugins do not run in v2 (new plugin API). Ours, in order of how much we depend on them:

  • mcpx bridge + mcpx-session — .opencode/plugin/mcpx-session.ts is the plugin entry (imports tool and Plugin from @opencode-ai/plugin; default export is async ({ directory, worktree, project, client }, options) => …), backed by the .opencode/plugin/mcpx/ modules (daemon client, ops). First step: inventory the v1 hooks/lifecycle points and SDK calls these use, and diff them against the v2 plugin API in the migration guide; list anything with no v2 equivalent.
  • subtask2 — third-party npm plugin @openspoon/subtask2@latest in the config plugin array, configured by .opencode/subtask2.jsonc. First step: check whether subtask2 ships a v2-compatible release; if not, decide between a fork, vendoring, or replacing it.
  • The rest of the plugin array is also v1-era npm plugins (opencode-working-memory, opencode-scheduler, opencode-pty, opencode-devcontainers, @openchamber/opencode-claude, @pieliesdie/opencode-antigravity-auth, and more). Each needs the same v2-compatibility check; the two items above are the ones we own or depend on most.
  • .opencode/package.json pins @opencode-ai/plugin 1.18.19 — the plugin SDK bump belongs to this workstream.

Status: config validation is being run first; plugin ports are scoped here but not started.

Acceptance criteria

  • Workstream 1 (config validation) is recorded as done: .opencode/opencode.jsonc loads clean under OpenCode v2 (validation comment, 2026-10-24); any accepted-but-ignored v1 fields are listed on this issue with a keep/drop decision each.
  • The mcpx bridge + mcpx-session plugin has a v2 port, or a written gap list naming every v1 hook/SDK call with no v2 equivalent and the chosen workaround.
  • subtask2 has a recorded decision: v2-compatible release adopted, fork/vendor chosen, or replacement named.
  • Every remaining plugin in the config plugin array has a v2-compatibility verdict recorded on this issue.
  • .opencode/package.json pins a v2-era @opencode-ai/plugin SDK and the repo's agents/commands/skills still load under the v2 CLI.

Activity

  1. dezren39 commented on Oct 24, 2026

    @dezren39
    MemberAuthor

    Config validation result — ran 2026-10-24

    Verdict: .opencode/opencode.jsonc loads clean under OpenCode v2. No PR opened — there are no hard incompatibilities in the config itself to fix. Details below; the plugin half of this issue is where the real breakage is (also below).

    Method

    • Installed @opencode/[email protected] in an isolated prefix with a scratch HOME (the live v1.18.31 server and its config were not touched).
    • Copied this repo's .opencode/ tree into a scratch project and ran:
      • opencode debug config → exit 0, zero WARN/ERROR lines.
      • opencode debug agents → exit 0; all agents resolve (config-defined build, classifier, classifier-complex, coder, reasoner, compaction, plus the agents/*.md agents Explore/General/Plan and built-ins).
      • A full project load by a fresh v2 server (for plugin behavior, below) → no config/schema errors in the server log.

    What v2 does with the v1-shaped config

    The v2 loader normalizes v1 fields itself — these renames happen automatically, no edit needed:

    v1 field v2 result
    agent agents (all 6 keys preserved)
    provider providers (all 14 provider IDs preserved exactly)
    plugin plugins (all 14 specs preserved)
    autoupdate: true update: "auto"
    disabled_providers policies (provider.use deny entries)
    compaction accepted, reshaped to v2 form

    Accepted but dropped (v2 ignores these — decision needed, not a fix)

    • default ("claude-code/claude-haiku-5-5") — does not appear in v2's resolved config, and v2 does not turn it into a model either. On upstream v2 this field is a no-op. Keeping it costs nothing while runtimes are still on v1; flagging it here so the set remembers it once the fork rebase decides whether our v2 line keeps a default-model concept.
    • experimental.model_routes — the model-pool routing table (cheap-pool targets etc.). Upstream v2 drops the whole experimental block. If pool routing is load-bearing for the fleet, it has to be carried by the fork rebase (origin issue, item (a)) or reimplemented — v2 upstream will not honor it.

    Neither field is rejected by v2, and removing them from the repo config now would change behavior for the still-on-v1 runtimes, so both stay until the runtime migration lands.

    Plugin load evidence (workstream 2 preview — ports NOT started)

    On the fresh v2 server load of the full tree (with .opencode/package.json deps installed, @opencode-ai/plugin 1.18.19), 8 plugins were attempted in the capture window and 6 failed with the same v2 module-contract error:

    PluginModule.LoadError: Plugin must export a default definition with an id and an effect or setup function.

    Failed:

    • plugin/mcpx-session.ts (ours — its v1-style async-function default export does not satisfy the v2 contract)
    • plugins/autoresearch-context.ts (ours)
    • @openspoon/subtask2@latest (subtask2's current release is not v2-compatible)
    • opencode-scheduler@latest, opencode-pty@latest, opencode-devcontainers@latest

    Attempted with no failure recorded in the window: opencode-working-memory@latest, @mohak34/opencode-notifier@latest. The remaining specs in the plugin array weren't reached in the window; assume v1-shaped until checked. This confirms the scoping in the issue body: the port's first step is the v2 plugin contract (id + effect/setup default export) vs the v1 hooks our plugins use.

  2. dezren39 commented on Oct 26, 2026

    @dezren39
    MemberAuthor

    Intake review — fleet monitor, 2026-10-26T08:26:24Z.

    Still live — partially advanced: workstream 1 is already done (the 2026-10-24 comment on this issue records .opencode/opencode.jsonc loading clean under OpenCode v2, no PR needed). Workstream 2 (plugin ports) is not started, per the issue body, and nothing since has changed that: the mcpx bridge inventory/diff against the v2 plugin API is still the first step. Acceptance criteria were missing and have been appended to the body (original text preserved verbatim above them).

    Related: this is one leg of a cross-repo set — origin issue developing-today-forks/opencode#374 (still open), sibling leg developing-today-forks/openchamber#384. Per the fleet cross-repo rule, the set is tracked from the origin issue; do not file per-repo duplicates.

    Suggested approach: sequence after the opencode#374 fork rebase lands a stable v2 plugin API surface; start with the mcpx-session hook inventory since the fleet depends on it most.

    Risks: porting against a moving v2 API wastes the effort; effort class l reflects the whole plugin array, not the mcpx bridge alone.

  3. added
    effort/l
    kind/feature
    meta/enriched
    priority/normal
    status/needs-triage
    on Oct 26, 2026
  4. dezren39 commented on Oct 29, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · cross-reference from #1858 triage (queue task 2746, 2026-10-29)

  5. added
    work/assigned
    queue/claimed
    status/in-progress
    and removed
    status/needs-triage
    on Nov 1, 2026
  6. dezren39 commented on Nov 1, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  7. dezren39 commented on Nov 1, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done

    • Agent: queue worker (repo-worker-code), lane F
    • Session / ID: queue task 2194 (triage)
    • Found via: queue claim
    • Task: Triage verdict for OpenCode 2: validate .opencode config against the v2 schema and port the v1 plugins #730 — WS1 DONE; WS2 CONFIRMED still owed, on current main 558cc1d23e1d2d90df2a0d36189b5e585f12f99b.
    • Verified at HEAD:
      • Workstream 1: done — the 2026-10-24 comment on this issue records .opencode/opencode.jsonc loading clean under OpenCode v2; nothing since contradicts it. Acceptance item 1's validation half is satisfied; the accepted-but-ignored field list was recorded in that same comment.
      • .opencode/package.json still pins @opencode-ai/plugin 1.18.19 — acceptance item 5 (v2-era SDK pin) not done.
      • .opencode/opencode.jsonc:6463-6478 — the plugin array now has 13 active entries (antigravity-auth commented out 2026-10-24); no comment on this issue records a v2 verdict for any of them, and subtask2 (@openspoon/subtask2@latest, :6467) has no recorded decision — acceptance items 3 and 4 not done.
      • .opencode/plugin/mcpx-session.ts:1 still imports { tool, type Plugin } from @opencode-ai/plugin (the v1 SDK) — the deployed copy is unported. Per the 2026-10-29 cross-reference, its port rides the shipped-plugin set: mcpx: port the opencode plugin to opencode v2 (a rewrite, and several things get better) #1858 / mcpx opencode v2 plugin: implement the #1858 SET-REMAINDER items (1)-(5) #2841, queue task 3997 (parked, items (1)(3)(4)(5) remain). Acceptance item 2 is owned there, not duplicated here.
    • Route: the unowned remainder (plugin-array verdicts + subtask2 decision, with the SDK bump gated on them) is split to linked issue OpenCode 2 (#730 WS2 remainder): plugin-array v2 verdict pass + subtask2 decision #3286 — filed because this issue's queue triage dedupe key is consumed by task 2194 itself (the enqueue returned 2194) — and enqueued as queue task 4850 (kind triage). This issue stays open as the parent tracker; labels synced to queue/queued for the routed remainder.
  8. 69 remaining items

  9. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    Contributor

    🤖 Agent note · lane 2207-M (Archer AUTHOR lane, charlie ADVANCE run, queue task 25977, 2026-11-28) — slice 1 disposition: park for packet-scope repair (re-verified firsthand). No code changed by this lane.

    This lane was served task 25977 by fleet agent next after the whole fallback band (ranks 8–17) premise-checked gated, and independently re-verified the scope conflict via the GitHub API on current main (gh CLI only, no clones):

    • .opencode/plugin/mcpx-session.ts and pkgs/mcpx/plugin/opencode/mcpx-session.ts are byte-identical mirrors: both blob sha e7f7c9d1d64dd961be2065b6e63d0a4bddf0ae47, size 33304.
    • .github/workflows/mcpx.yml runs diff pkgs/mcpx/plugin/opencode/mcpx-session.ts .opencode/plugin/mcpx-session.ts in both the PR plugin-sync job (lines 101–105) and the test job (lines 179–183) — a PR changing only the deployed copy fails this mandatory check by construction.
    • The deployed file still opens with import { tool, type Plugin } from "@opencode-ai/plugin" (v1), and .opencode/package.json directly pins only @opencode-ai/plugin 1.19.6 — no v2 @opencode/plugin dependency is declared.
    • The packet's owned_paths list only .opencode/plugin/mcpx-session.ts and explicitly exclude both the packaged mirror and the .opencode/package.json SDK pin bump, so the slice as scoped cannot land.

    This concurs with oc-code-03 (2026-11-27T02:42:05Z), lane 2122-A, code-h and any-o — the conflict is unchanged on current main.

    Resume condition (not a person): the packet is re-scoped to either (a) include BOTH mirrored entrypoints plus the v2 SDK pin in .opencode/package.json, or (b) a separate v2 deployed adapter file with a declared v2 dependency and a v2 load test. On re-scope, this task is a bounded, workable port following the landed pkgs/mcpx/plugin/opencode/v2/tools.ts pattern.

    Key: 2207-M

  10. added
    queue/claimed
    status/in-progress
    work/assigned
    queue/parked
    status/parked
    and removed
    status/in-progress
    queue/claimed
    on Nov 29, 2026
  11. dezren39 commented on Nov 29, 2026

    @dezren39
    MemberAuthor

    Census 2026-11-29 (lane CEN-C01) — body + all 31 comments re-read. Consolidated state:

    • Workstream 1 (config validation): DONE (2026-10-24) — .opencode/opencode.jsonc loads clean under OpenCode v2 (@opencode/[email protected], debug config/debug agents exit 0). The acceptance box for listing accepted-but-ignored v1 fields with keep/drop decisions is still unchecked — that listing is the only workstream-1 remainder.
    • Workstream 2 (plugin ports): NOT STARTED, and the first slice packet (queue task 25977) is defective as scoped — verified firsthand by three lanes (2026-11-27 → 2026-11-29, comments above): .opencode/plugin/mcpx-session.ts and pkgs/mcpx/plugin/opencode/mcpx-session.ts are byte-identical mirrors (blob e7f7c9d1d), and .github/workflows/mcpx.yml fails any PR where they differ (plugin-sync job + test job). The packet owned only the deployed copy and excluded both the packaged mirror and the .opencode/package.json SDK pin — yet a v2 entrypoint imports @opencode/plugin, which is not a direct dependency there (only v1 @opencode-ai/plugin is pinned). A one-file port cannot merge, by construction.
    • Repaired scope for the next packet (either route works): (a) keep the v1 mirror pair intact and add the v2 deployed adapter as a separate file/entry with a declared v2 SDK dependency and a real v2 load test; or (b) widen the packet to own both mirrored entrypoints plus the .opencode/package.json SDK pin. Note the v2 tree in pkgs/mcpx/plugin/opencode/v2/ already registers seven tools (incl. mcpx_daemon_pick) vs six on the deployed v1 surface — the port must account for that delta.
    • Still owed after the mcpx port: the subtask2 decision (v2 release / fork / vendor / replace) and a v2-compatibility verdict for every remaining plugin in the config plugin array.
    • Blockers: no Drew decision pending; the blocker is the packet scope above. Priority priority/normal confirmed appropriate.
  12. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    Contributor

    Census 2026-11-29 (Felix): full re-read (body, labels, all comments, edges) in the CODE-6 recovery pass, concurring with the parallel census note (lane CEN-C01) already on this thread, whose claims I verified against live state in this pass.

    STRENGTHS: workstream 1 (config validation) is DONE (2026-10-24, loads clean under OpenCode v2); workstream 2's state is honestly recorded — not started, and the first slice packet was parked twice for packet-scope repair (tasks 25977), most recently re-verified 2026-11-28. This issue is also the native blocker for #2841 (edge verified in place).
    GAPS: carried THREE status labels (status/in-review, status/parked, status/triaged); nothing is in review — the parked state is operative.
    FIXES I APPLIED: removed status/in-review; status/parked + status/triaged stand.
    REMAINS: repair the slice-1 packet scope (the mcpx dogfood-plugin sync conflict recorded in-thread), then the plugin ports in dependency order (mcpx bridge first); also the workstream-1 remainder — the accepted-but-ignored v1 fields listing with keep/drop decisions. No Drewry decision needed.

  13. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    Contributor

    Issue census — 2026-11-29

    Gaps found: No app/*/area/* label (the plugin work is TypeScript under .opencode/plugin/); no source/* label — left off rather than guessed, as the filer is not recorded. An ## Acceptance criteria section is present. Three status labels coexist (status/in-review/status/parked/status/triaged) — lifecycle state is queue-owned and was not hand-edited.

    Strengths: Two clearly separated workstreams (config validation, then plugin ports) with the current state stated honestly (validation running first, plugin ports scoped but not started), the upstream migration guide linked, and the origin issue (opencode#374) named.

    Actions taken by this census: Labels added: area/typescript.

  14. developing-today-fleet commented on Nov 30, 2026

    @developing-today-fleet
    Contributor

    🤖 Claim — lane 0052-J (Archer, bravo SUSTAIN 2026-11-30 00:52 CST), fallback rank 179.

    Taking workstream 1 only: config validation of .opencode/opencode.jsonc (+ cli.json / tui.jsonc) against the OpenCode v2 schema. Method: read the config files via the contents API (no checkout), validate fields against the v2 schema + the upstream migration guide, and record accepts / hard-rejects / accepted-but-ignored on this issue. Plugin ports (workstream 2) are NOT in this slice. Any hard rejection found gets a bounded fix PR; otherwise the record on this issue is the deliverable.

  15. developing-today-fleet commented on Nov 30, 2026

    @developing-today-fleet
    Contributor

    🤖 Workstream 1 (config validation) — record of record, lane 0052-J (Archer, bravo SUSTAIN 2026-11-30).

    Method: .opencode/opencode.jsonc, .opencode/cli.json, .opencode/tui.jsonc read via the contents API at current main (no checkout); opencode.jsonc parsed as JSONC (valid, 5,679 lines); fields checked against the V1 schema (opencode.ai/config.json), the V2 CLI schema (opencode.ai/v2/cli.json, fetched live), and the upstream V2 migration guide (dev.opencode.ai/v2/docs/migrate-v1/, read in full). A live V2-binary load test was NOT run — the verdicts below are schema/guide verdicts, and the guide states supported V1 config is normalized in memory without rewriting the source.

    Verdict: no hard rejections found — no fix PR required for workstream 1

    Every top-level field in opencode.jsonc is either kept as-is, silently normalized, or in the guide's accepted-but-ignored class. Nothing in the config blocks a V2 load.

    Kept / already V2-shaped

    • model, instructions (4 repo instruction files) — unchanged in V2.
    • agents (7 entries) — already the plural V2 name; entries already use plural permissions (5). BUT see ignored-fields below for temperature inside agents.
    • plugins — already the plural V2 name and V2 entry shape ({package, options} objects + string entries); first entry already points at a v2 plugin path (../pkgs/mcpx/plugin/opencode/v2). (Whether the implementations run under the V2 plugin API is workstream 2, not this slice.)
    • cli.json — validates clean against the live V2 CLI schema (jsonschema check, this lane): theme/diffs/session/animations all conform.
    • compaction — only reserved (8192) is set; it carries to V2 buffer. No tail_turns/prune, so no ignored-field warning from compaction.

    Silently normalized from V1 form (supported, no warning, no action needed)

    • provider (singular, 37 entries) → providers; per-provider npm (21) → package with aisdk: prefix; options (20) → split into settings/headers/body; model variants objects (16) → V2 arrays with id; model id (15) → modelID.
    • disabled_providers (8) → internal deny policies. autoupdate: true → update: "auto". small_model → the built-in title agent's model (native V2 form would be agents.title.model).

    Accepted but ignored / no V2 effect (decide keep-or-drop; they are NOT load errors)

    • Agent-level temperature (4 agents): per the guide, V1 agent temperature/top_p/options have no effect in V2 — sampling belongs on a model variant. This is the one finding with real behavioral bite: those 4 agents will run at model defaults under V2 until their temperature moves to a variant.
    • tui.jsonc (theme: "vibrant-ink" as a bare string): after cli.json exists, tui.json edits are ignored; and per the guide the V2 client config is the global ~/.config/opencode/cli.json — project-local client files are not migrated. Flagging, not asserting: whether the repo's .opencode/cli.json is honored by the V2 client should be confirmed in the workstream-2/live-load pass.

    Custom fleet fields — in neither schema (ignored by OpenCode core in both versions; presumably read by our own routing/tooling, listed so they are not mistaken for config errors)

    • Top level: messaging ({embedding: "off"}), model_designations, websearch.provider, warming: true (the last two ARE in the V1 schema; no V2 equivalent named in the guide).
    • Provider level: instanceOf (17), wallScope (8), tokenMetering (1). Agent level: maxTokens (2), request (4), threshold (1), mode (5). Experimental: provider_routes, model_routes, model_route_windows — none of the guide's ignored V1 experimental fields (batch_tool, openTelemetry, primary_tools, continue_loop_on_deny) are present.

    Remaining for #730: workstream 2 (plugin ports — mcpx bridge first) and a live V2 load test to confirm the schema verdicts on the actual binary. This slice (workstream-1 record) is complete; claim released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/typescripteffort/lepic/opencode-platformkind/featuremeta/enrichedpriority/normalqueue/parkedstatus/parkedstatus/triagedwork/assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions