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/cli@2.1.4) 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/cli@2.1.4 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/lLarge: multi-day or open-ended; expect staged check-ins
    kind/featureNew feature or capability request
    meta/enrichedIntake review done: acceptance criteria, links, and normalized labels added
    priority/normalOrdinary priority (the default)
    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/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed 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. 48 remaining items

  9. added and removed
    user/escalatedRequires a Drew decision or access
    queue/blockedQueue or user escalation state
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 12, 2026
  10. dezren39 commented on Nov 17, 2026

    @dezren39
    MemberAuthor

    agent-note:v1 — triage (queue task 18039, openchamber scheduled lane code-g)\n\nVerdict: the v2 migration is substantially implemented in this repository, but issue #730 remains an open umbrella with two workstreams and no recent closure disposition. Fresh evidence: uses the v2 config schema and the default routed model; merged PRs #2489 (mcpx plugin v2 core), #2457 (v2 plugin API research), and #4594 (canonical v2 plugins/agents config keys) cover core migration pieces. The fleet parent developing-today-forks/opencode#374 is still OPEN.\n\nThis is not safe to mark already_done based on partial search; the issue body includes more plugins and config validation. No bounded implementation chosen in triage; owner should close/narrow this umbrella against remaining plugin ports. No follow-on packet enqueued.

  11. dezren39 commented on Nov 17, 2026

    @dezren39
    MemberAuthor

    agent-note:v1 — triage (queue task 18039, openchamber scheduled lane code-g)

    Verdict: the v2 migration is substantially implemented in this repository, but issue #730 remains an open umbrella with two workstreams and no recent closure disposition. Fresh evidence: .opencode/opencode.jsonc uses the v2 config schema and the default routed model; merged PRs #2489 (mcpx plugin v2 core), #2457 (v2 plugin API research), and #4594 (canonical v2 plugins/agents config keys) cover core migration pieces. The fleet parent developing-today-forks/opencode#374 is still OPEN.

    This is not safe to mark already_done based on partial search; the issue body includes more plugins and config validation. No bounded implementation chosen in triage; owner should close/narrow this umbrella against remaining plugin ports. No follow-on packet enqueued.

  12. dezren39 commented on Nov 17, 2026

    @dezren39
    MemberAuthor

    Agent note — triage revalidation (task 19385, lane any-m, 2026-11-17)

    State: triaged — remainder verdict of task 13572 (2026-11-12) re-verified fresh; nothing has changed that alters the routing.

    Issue stays OPEN as the parent tracker until #1858 / #2841 close out the mcpx port and SDK bump.

  13. removed their assignment
    on Nov 20, 2026
  14. added a commit that references this issue on Nov 23, 2026
  15. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · Lane DL (archer pickup via fleet agent next, shortlist rank 5) — criterion 2's gap-list branch is now satisfied; fresh reconciliation of all five criteria below.

    Landed: PR #12841 (merged, merge commit 798c240e51c6cf552d01cff8f127d396c103e96b) adds doc/2026-11-23T03-45-00Z_opencode-v2-deployed-plugin-gap-list/gap-list.md — the written gap list for the deployed .opencode/ plugins, inventoried line-by-line from main 1d6d8f07 (all cited files verified blob-identical at the PR base ff6c05b9).

    Gap-list result: the deployed mcpx-session.ts (783 lines; SDK import line 1; six tool({...}) tools at lines 436–599; hooks shell.env 635, experimental.chat.system.transform 723, tool.execute.after 765; client.session.get 360; client.tui.showToast 106/259) and autoresearch-context.ts (its only hook: the transform, line 26) use exactly three v1 constructs with no v2 equivalent, each with its chosen workaround recorded in the doc:

    1. the tool() helper / Plugin hook-map contract → define() + tool.transform (landed pattern: pkgs/mcpx/plugin/opencode/v2/tools.ts);
    2. experimental.chat.system.transform → session.hook("context") → event.system (v2/context.ts);
    3. per-command shell.env injection (v2's shell.create.before has no sessionID) → one PUT /api/experimental/session/:id/environment per session (v2/session-env.ts).
      Plus client.tui.showToast: no verified 1:1 v2 equivalent — degrade-to-log workaround. Everything else has a v2 equivalent already implemented in the shipped v2 core (PR feat(mcpx): opencode v2 plugin core — {id, setup}, namespaced tools, ctx.storage (#1858) #2489).

    Fresh reconciliation of the other criteria (verified today against current main):

    Ownership note: #2841's body assigns the deployed-copy port to #730 ("The deployed .opencode/plugin/ copy port — #730 owns it"), while #1858/#2841 own the shipped-package set — this note follows #2841's assignment.

    Next slice (named, not started here): the deployed-copy port itself, sequenced per the #3286 survey resume plan — port mcpx-session.ts to define() + domains adopting the shipped v2 core, port the TUI surface, then move the pin to @opencode/plugin and regen the lock, closing criterion 5. It is a full-run task, not a short-lane change: it rewrites the live .opencode/ plugin surface of the host running the fleet. #730 stays open as parent tracker until that port lands; the fleet parent developing-today-forks/opencode#374 remains open.

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

    effort/lLarge: multi-day or open-ended; expect staged check-insepic/opencode-platformReprioritization program epic (2026-11-12)kind/featureNew feature or capability requestmeta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedpriority/normalOrdinary priority (the default)status/triagedTriaged and routed (see agent note)status:in-review

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions