Skip to content

Feat/opencode v2 - #6

Merged
AlexMKX merged 5 commits into
masterfrom
feat/opencode-v2
Oct 23, 2026
Merged

AlexMKX merged 5 commits into
masterfrom
feat/opencode-v2

Conversation

@AlexMKX

@AlexMKX AlexMKX commented Oct 23, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

AlexMKX and others added 5 commits October 22, 2026 22:01
index.js is now the package main and carries both generations: OpenCode 2
calls setup (.opencode/plugins/orchestrate-v2.js), OpenCode 1 calls a lazy
server that loads the unchanged V1 entry, so @opencode-ai/plugin is never
imported on a V2 host.

The V2 entry wires the same pure modules to the V2 API: skills via
ctx.skill.transform, bootstrap and role-prompt refresh via the context
session hook, [TASK OUTCOME]/[CACHE STATUS] via execute.after on the
subagent tool, squad_* tools with JSON Schema inputs, and the rate-limit
guard via the retry hook (vetoes the retry instead of aborting) plus the
event stream for terminal errors and silent hangs. V2 shapes are converted
at the edge in src/v2/adapt.js.

Shared by both entries now: tool wording and variant checks
(src/squad-tools.js), task notes (src/task-notes.js) and the process-wide
lookups (.opencode/plugins/runtime.js).

Not available on V2: toasts (no TUI handle for server plugins) and
squad_compact's model choice (V2 compaction takes no model).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ariables

The runtime.js extraction carried the _inventoryCache/_hasSquadCache
declarations along, leaving orchestrate.js referencing undeclared
variables (ReferenceError on the first V1 turn). Enable biome's
noUndeclaredVariables so this class of slip fails the lint.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…per-project model_data on V2

.opencode/plugins/ is auto-loaded by both hosts when opencode runs in this
repo, so only the V1 entry stays there. On V2 the background service's cwd
is not the project, so model_data.json is resolved from ctx.location and
cached per directory.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@AlexMKX
AlexMKX merged commit 531a0e9 into master Oct 23, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant