Skip to content

feat(opencode2): add native core integration with a v1 fallback - #167

Merged
pgermishuys merged 6 commits into
mainfrom
feat/opencode2-core-release
Sep 13, 2026
Merged

pgermishuys merged 6 commits into
mainfrom
feat/opencode2-core-release

Conversation

@josevelaz

@josevelaz josevelaz commented Sep 9, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Add native V2 core integration in the independent @weaveio/weave-adapter-opencode2 package: catalog-backed agents, foreground/background delegation, config refresh, and read-only plan RPC with an optional TUI.
  • Preserve @weaveio/weave-adapter-opencode as the V1 fallback. Its runtime source matches main; stale changelog conflict markers were removed.
  • Preserve the V2 root OpenCode2Adapter facade while routing its ./server entry through the new core integration.
  • Harden shared config and prompt handling, remove builtin temperature overrides, and clarify task/review report formats.
  • Accept optional fast and settings.delegation.max_concurrency configuration intent. Neither setting is enforced at runtime by the V2 adapter.

Related issues: #53 and #165. This PR does not claim to resolve every requirement in those issues.

Merge resolution

Merged remote main into this feature branch. Kept main's independent V1/V2 package design, as requested, rather than replacing the V1 package. The execution-controls spec is now Spec 35 to preserve main's Specs 33 and 34. No local-main-only workstream commits are included.

The V2 SDK and runtime proof use the package's existing exact pin, 0.0.0-beta-19151. Build entries, declarations, package wrappers, installer selection, tests, and docs now target the separate V2 package.

Verification

  • Full suite and commit hooks: 5,818 passed, 12 skipped, 0 failed.
  • Final independent review findings were addressed: await lazy agent replay before command registration/reload, use explicit local model fixtures for Podman verification, add four-layer execution-control tests plus merge/descriptor coverage, and correct the package-entry documentation.
  • Typecheck, build, lint, declaration checks, and documentation links passed. Lint has existing warnings/informational diagnostics.
  • V2 source-boundary and version-drift checks passed.
  • Live V1 fallback proof passed on OpenCode 1.18.9: default agent, builtins/disable, mode, permissions, composed prompts, commands, user override, and custom agent.
  • All 20 packaged V2 runtime checks passed on 0.0.0-beta-19151, including native foreground and background children, model/variant intent, configured skills, tool policy, plan RPC, refresh, collision handling, interruption, and cleanup.
  • Checks used isolated HOME/XDG environments. Hooks stayed enabled.

Evidence: docs/artifacts/opencode2-package-merge-proof.md.

Limits

The runtime provider is deterministic; this does not prove real-model specialist-selection accuracy. No new interactive TUI proof is claimed for the merged package. The native core integration does not supply durable workflows. Fast service and strict per-parent live-child concurrency remain configuration intent only, not runtime resource or cost controls.

@coderabbitai

coderabbitai Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Too many files!

This PR contains 204 files, which is 104 over the limit of 100.

To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch.

Upgrade to a paid plan to raise the limit.

This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: e2baac23-fdda-41f8-bee2-467eec8ac3c3

📥 Commits

Reviewing files that changed from the base of the PR and between 957b6b7 and 914b3f4.

⛔ Files ignored due to path filters (10)
  • .codesight/CODESIGHT.md is excluded by !.codesight/**
  • .codesight/config.md is excluded by !.codesight/**
  • .codesight/coverage.md is excluded by !.codesight/**
  • .codesight/events.md is excluded by !.codesight/**
  • .codesight/graph.md is excluded by !.codesight/**
  • .codesight/libs.md is excluded by !.codesight/**
  • bun.lock is excluded by !**/*.lock
  • docs/specs/34-spec-opencode2-adapter/34-spec-opencode2-adapter.md is excluded by !docs/specs/**
  • docs/specs/36-spec-execution-controls/36-spec-execution-controls.md is excluded by !docs/specs/**
  • docs/specs/README.md is excluded by !docs/specs/**
📒 Files selected for processing (204)
  • .changeset/fast-intent-and-trigger-simplification.md
  • .changeset/portable-delegation-limits.md
  • .weave/config.weave
  • .weave/prompts/shuttle.md
  • .weave/prompts/weft.md
  • bunfig.toml
  • docs/README.md
  • docs/adapter-boundary.md
  • docs/adapter-readiness-status.md
  • docs/adapters/opencode2-core.md
  • docs/adr/0003-opencode-adapter-materialization-shape.md
  • docs/artifacts/opencode2-core-contract-audit.md
  • docs/artifacts/opencode2-core-runtime-proof.md
  • docs/artifacts/opencode2-core-ui-proof.md
  • docs/artifacts/opencode2-package-merge-proof.md
  • docs/artifacts/opencode2-shared-contract-recovery.md
  • docs/artifacts/opencode2-start-command-proof.md
  • docs/cli.md
  • docs/config-loading.md
  • docs/dsl-reference.md
  • docs/model-resolution.md
  • docs/opencode2-adapter.md
  • docs/prompt-composition.md
  • docs/testing/opencode2-verification.md
  • package.json
  • packages/adapters/claude-code/src/__tests__/agent-translation.test.ts
  • packages/adapters/opencode/CHANGELOG.md
  • packages/adapters/opencode/src/__tests__/category-routing-smoke.test.ts
  • packages/adapters/opencode2/CHANGELOG.md
  • packages/adapters/opencode2/README.md
  • packages/adapters/opencode2/api-extractor.rpc.json
  • packages/adapters/opencode2/api-extractor.tui.json
  • packages/adapters/opencode2/etc/weave-adapter-opencode2-rpc.api.md
  • packages/adapters/opencode2/etc/weave-adapter-opencode2-server.api.md
  • packages/adapters/opencode2/etc/weave-adapter-opencode2-tui.api.md
  • packages/adapters/opencode2/package.json
  • packages/adapters/opencode2/rpc.js
  • packages/adapters/opencode2/server.js
  • packages/adapters/opencode2/src/__tests__/v2-agent-registration.test.ts
  • packages/adapters/opencode2/src/__tests__/v2-catalog.test.ts
  • packages/adapters/opencode2/src/__tests__/v2-commands.test.ts
  • packages/adapters/opencode2/src/__tests__/v2-config-refresh.test.ts
  • packages/adapters/opencode2/src/__tests__/v2-config-source.test.ts
  • packages/adapters/opencode2/src/__tests__/v2-delegation.test.ts
  • packages/adapters/opencode2/src/__tests__/v2-fixtures.ts
  • packages/adapters/opencode2/src/__tests__/v2-health.test.ts
  • packages/adapters/opencode2/src/__tests__/v2-model-resolution.test.ts
  • packages/adapters/opencode2/src/__tests__/v2-options.test.ts
  • packages/adapters/opencode2/src/__tests__/v2-plan-session-state.test.ts
  • packages/adapters/opencode2/src/__tests__/v2-plan-ui-state.test.ts
  • packages/adapters/opencode2/src/__tests__/v2-plan-ui.test.ts
  • packages/adapters/opencode2/src/__tests__/v2-plugin-loader-shape.test.ts
  • packages/adapters/opencode2/src/__tests__/v2-plugin.test.ts
  • packages/adapters/opencode2/src/__tests__/v2-rpc.test.ts
  • packages/adapters/opencode2/src/__tests__/v2-session-hooks.test.ts
  • packages/adapters/opencode2/src/__tests__/v2-session-scope.test.ts
  • packages/adapters/opencode2/src/__tests__/v2-tool-policy-mapping.test.ts
  • packages/adapters/opencode2/src/__tests__/v2-translate-agent.test.ts
  • packages/adapters/opencode2/src/rpc.ts
  • packages/adapters/opencode2/src/sdk-types.ts
  • packages/adapters/opencode2/src/sdk-ui.ts
  • packages/adapters/opencode2/src/server.ts
  • packages/adapters/opencode2/src/tui.tsx
  • packages/adapters/opencode2/src/v2/agent-registration.ts
  • packages/adapters/opencode2/src/v2/catalog.ts
  • packages/adapters/opencode2/src/v2/commands.ts
  • packages/adapters/opencode2/src/v2/config-refresh.ts
  • packages/adapters/opencode2/src/v2/config-source.ts
  • packages/adapters/opencode2/src/v2/delegation.ts
  • packages/adapters/opencode2/src/v2/errors.ts
  • packages/adapters/opencode2/src/v2/health.ts
  • packages/adapters/opencode2/src/v2/host-types.ts
  • packages/adapters/opencode2/src/v2/model-resolution.ts
  • packages/adapters/opencode2/src/v2/options.ts
  • packages/adapters/opencode2/src/v2/plan-catalog.ts
  • packages/adapters/opencode2/src/v2/plan-name.ts
  • packages/adapters/opencode2/src/v2/plan-session-state.ts
  • packages/adapters/opencode2/src/v2/plan-ui-state.ts
  • packages/adapters/opencode2/src/v2/plan-ui.tsx
  • packages/adapters/opencode2/src/v2/plugin.ts
  • packages/adapters/opencode2/src/v2/rpc-handlers.ts
  • packages/adapters/opencode2/src/v2/session-hooks.ts
  • packages/adapters/opencode2/src/v2/session-scope.ts
  • packages/adapters/opencode2/src/v2/tool-policy-mapping.ts
  • packages/adapters/opencode2/src/v2/translate-agent.ts
  • packages/adapters/opencode2/tsconfig.build.json
  • packages/adapters/opencode2/tsconfig.json
  • packages/adapters/opencode2/tui.js
  • packages/adapters/opencode2/verify/container-smoke.ts
  • packages/adapters/opencode2/verify/fixtures-layer6/.weave/config.weave
  • packages/adapters/opencode2/verify/fixtures-layer6/opencode.jsonc
  • packages/adapters/opencode2/verify/fixtures-layer6/plugin-wrapper/server.ts
  • packages/adapters/opencode2/verify/fixtures/agent-materialization/.weave/config.weave
  • packages/adapters/opencode2/verify/fixtures/agent-materialization/opencode.jsonc
  • packages/adapters/opencode2/verify/fixtures/opencode.jsonc
  • packages/cli/CHANGELOG.md
  • packages/cli/package.json
  • packages/cli/src/__fixtures__/valid.weave
  • packages/cli/src/cli.ts
  • packages/cli/src/commands/__tests__/config-validation-errors.test.ts
  • packages/cli/src/commands/__tests__/init.test.ts
  • packages/cli/src/commands/__tests__/migrate-conversion.test.ts
  • packages/cli/src/commands/__tests__/prompt.test.ts
  • packages/cli/src/commands/__tests__/shared-intent-migration.test.ts
  • packages/cli/src/commands/compose.ts
  • packages/cli/src/commands/init.ts
  • packages/cli/src/commands/prompt.ts
  • packages/cli/src/commands/validate.ts
  • packages/cli/src/config/starter-config.ts
  • packages/cli/src/detect/__tests__/detect.test.ts
  • packages/cli/src/detect/index.ts
  • packages/cli/src/detect/probes.ts
  • packages/cli/src/evals/__tests__/loom-delegation-matrix.test.ts
  • packages/cli/src/evals/__tests__/prompt-snapshots.test.ts
  • packages/cli/src/fs/file-system.ts
  • packages/cli/src/installers/__tests__/installers.test.ts
  • packages/cli/src/installers/index.ts
  • packages/cli/src/installers/opencode2.ts
  • packages/cli/src/migration/__tests__/legacy-jsonc-inspect.test.ts
  • packages/cli/src/migration/legacy-conversion-diagnostics.ts
  • packages/cli/src/migration/legacy-dsl-identifiers.ts
  • packages/cli/src/migration/legacy-jsonc-converter.ts
  • packages/cli/src/migration/legacy-jsonc-inspect.ts
  • packages/config/package.json
  • packages/config/prompts/loom.md
  • packages/config/prompts/pattern.md
  • packages/config/prompts/tapestry.md
  • packages/config/src/__tests__/builtin-prompts.test.ts
  • packages/config/src/__tests__/builtins.test.ts
  • packages/config/src/__tests__/category-shuttle-builtin-prompts.test.ts
  • packages/config/src/__tests__/merge.test.ts
  • packages/config/src/__tests__/plan-task-parser.test.ts
  • packages/config/src/__tests__/plan-task-reader.test.ts
  • packages/config/src/__tests__/resolve.test.ts
  • packages/config/src/builtins.ts
  • packages/config/src/errors.ts
  • packages/config/src/index.ts
  • packages/config/src/merge.ts
  • packages/config/src/plan-task-parser.ts
  • packages/config/src/plan-task-reader.ts
  • packages/core/src/__tests__/lexer.test.ts
  • packages/core/src/__tests__/parse_config.test.ts
  • packages/core/src/__tests__/parser.test.ts
  • packages/core/src/__tests__/safe-graph-copy.test.ts
  • packages/core/src/__tests__/schema.test.ts
  • packages/core/src/__tests__/shared-intent.test.ts
  • packages/core/src/__tests__/validate.test.ts
  • packages/core/src/ast.ts
  • packages/core/src/config-error-policy.ts
  • packages/core/src/index.ts
  • packages/core/src/lexer.ts
  • packages/core/src/parser.ts
  • packages/core/src/safe-graph-copy.ts
  • packages/core/src/schema.ts
  • packages/core/src/validate.ts
  • packages/docs/src/content/docs/docs/agents-and-categories.mdx
  • packages/docs/src/content/docs/docs/index.mdx
  • packages/docs/src/content/docs/docs/reference/adapters/index.mdx
  • packages/docs/src/content/docs/docs/reference/adapters/opencode2.mdx
  • packages/docs/src/content/docs/docs/reference/dsl/index.mdx
  • packages/engine/README.md
  • packages/engine/src/__tests__/category-routing-scaling.test.ts
  • packages/engine/src/__tests__/category-shuttle-routing.test.ts
  • packages/engine/src/__tests__/compose.test.ts
  • packages/engine/src/__tests__/descriptors.test.ts
  • packages/engine/src/__tests__/materialization-orchestration.test.ts
  • packages/engine/src/__tests__/materialization.test.ts
  • packages/engine/src/__tests__/plan-active-task.test.ts
  • packages/engine/src/__tests__/plan-task-snapshot.test.ts
  • packages/engine/src/__tests__/skill-resolution.test.ts
  • packages/engine/src/__tests__/template-context.test.ts
  • packages/engine/src/__tests__/template-renderer.test.ts
  • packages/engine/src/compose.ts
  • packages/engine/src/descriptors.ts
  • packages/engine/src/index.ts
  • packages/engine/src/materialization.ts
  • packages/engine/src/plan-active-task.ts
  • packages/engine/src/plan-task-snapshot.ts
  • packages/engine/src/skill-resolution.ts
  • packages/engine/src/template-context.ts
  • packages/engine/src/template-renderer.ts
  • plugins/copilot/com.github.copilot/agents/loom.agent.md
  • plugins/copilot/com.github.copilot/agents/pattern.agent.md
  • plugins/copilot/com.github.copilot/agents/shuttle-adapters.agent.md
  • plugins/copilot/com.github.copilot/agents/shuttle-core.agent.md
  • plugins/copilot/com.github.copilot/agents/shuttle-docs.agent.md
  • plugins/copilot/com.github.copilot/agents/shuttle-engine.agent.md
  • plugins/copilot/com.github.copilot/agents/shuttle-scripts.agent.md
  • plugins/copilot/com.github.copilot/agents/shuttle.agent.md
  • plugins/copilot/com.github.copilot/agents/spindle.agent.md
  • plugins/copilot/com.github.copilot/agents/tapestry.agent.md
  • plugins/copilot/com.github.copilot/agents/thread.agent.md
  • plugins/copilot/com.github.copilot/agents/warp.agent.md
  • plugins/copilot/com.github.copilot/agents/weft.agent.md
  • scripts/__tests__/opencode2-package-build.test.ts
  • scripts/build-public-packages.ts
  • scripts/constants.ts
  • scripts/opencode2/__tests__/proof-cases.test.ts
  • scripts/opencode2/fixtures/provider.ts
  • scripts/opencode2/proof-cases.ts
  • scripts/opencode2/proof-environment.ts
  • scripts/opencode2/verify-runtime.ts
  • scripts/validate-api-extractor-configs.ts
  • tsconfig.json

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

josevelaz added a commit that referenced this pull request Sep 9, 2026
Keep V1 and V2 in independent packages. Route the V2 server through the core integration while retaining its public adapter facade, and reconcile build entries, SDK pins, docs, and verification paths.

Refs: #167, #53, #165
@josevelaz josevelaz changed the title feat(opencode): add the v2 core release integration feat(opencode2): add native core integration with a v1 fallback Sep 9, 2026
josevelaz added a commit that referenced this pull request Sep 9, 2026
Resolve lazy command registration, replace model-fallback assumptions with an explicit local proof provider, cover execution-control contracts across layers, and correct the published entrypoint table.

Refs: #167
josevelaz added a commit that referenced this pull request Sep 9, 2026
Observe owned agents after host provider configuration activates instead of asserting against the setup-time snapshot. Bound observation and preserve cleanup on timeout.

Refs: #167
josevelaz and others added 6 commits September 13, 2026 07:25
Materialize Weave agents through the pinned OpenCode V2 plugin API, add native delegation and plan UI/RPC support, and harden config and prompt processing.

Accept fast and delegation concurrency intent without claiming runtime enforcement on the pinned host.

Keep V1 and V2 in independent packages. Route the V2 server through the core integration while retaining its public adapter facade, and reconcile build entries, SDK pins, docs, and verification paths.

Remove explicit temperature overrides that can cause provider rejection, and align builtin tests with unset sampling defaults.

Squashed while rebasing #167 onto main, because the original merge-from-main commit carried the V1/V2 package split and could not be linearized commit by commit:
- e049b7c feat(opencode): add the v2 core release integration
- 0afbd70 fix(config): leave builtin sampling defaults to providers
- d5aa573 docs(prompts): clarify task and review report formats
- 237040d docs(release): correct execution control support claims
- 3515e4d fix(opencode2): merge main and preserve the v1 fallback

Rebase resolutions against #168 and #170:
- Renumber the Execution Controls spec from 35 to 36; main landed Spec 35 (Verification Trajectory Evals) first.
- Pattern prompt: keep flat tasks with implementation outlines and pitfalls, and add verify-by acceptance criteria and checkbox Verification checks.
- Repo Weft prompt: adopt the trace-before-blocking path:line blocker contract.
- Regenerate bun.lock, .codesight/, and the Copilot plugin bundle.

Refs: #167, #53, #165

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01URSHV7iLPkwVvxXyJcC5K8
Resolve lazy command registration, replace model-fallback assumptions with an explicit local proof provider, cover execution-control contracts across layers, and correct the published entrypoint table.

Refs: #167
Observe owned agents after host provider configuration activates instead of asserting against the setup-time snapshot. Bound observation and preserve cleanup on timeout.

Refs: #167
Compose the builtin prompt directly so global user overrides cannot change the planning contract under test.
Share Location-bound admission between the native command and TUI RPC. Preserve explicit plan selection, scope checks, and failure reporting.
Backport the shared routing contract without replacing OpenCode variants, validation safeguards, or prompt readers. Migrate category routing, CLI conversion, templates, and affected regression tests so valid project configs register native agents again.
@pgermishuys
pgermishuys force-pushed the feat/opencode2-core-release branch from 4f22dd8 to 914b3f4 Compare September 13, 2026 07:26
@pgermishuys
pgermishuys merged commit 0885cba into main Sep 13, 2026
6 checks passed
@pgermishuys
pgermishuys deleted the feat/opencode2-core-release branch September 13, 2026 07:27
pgermishuys added a commit that referenced this pull request Sep 13, 2026
* docs(changeset): state the 0.2.0 DSL breaking changes accurately

#167 rewrote this changeset to say structured triggers and category
`patterns` "remain supported" and that `fast false` is accepted. The code
does the opposite: object triggers and `patterns` are rejected, every
category needs a `description`, templates lose `domains` and trigger
objects, and only `fast true` is valid. Every 0.1.x category required
`patterns`, so every existing category block breaks on upgrade.

Restate the breaking changes and the upgrade path so the 0.2.0 release
notes match the behavior.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016wLPimWh3uHKyD8TdSzgC8

* docs(changeset): describe validation and migration limits; drop CategoryMetadata.patterns

Address review: weave validate can stop at an object-trigger error before
reporting later ones, and weave init migrate drops object triggers and
patterns and skips categories without a description rather than
converting them. Show the triggers loop inside delegation.targets, and
remove patterns from the adapter-boundary CategoryMetadata contract to
match packages/engine/src/compose.ts.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016wLPimWh3uHKyD8TdSzgC8

* docs: drop category patterns and template domains from the adapter contracts

Address review: adapter-boundary's descriptor bullet and field table,
the engine README, Spec 16, and ADR 0001 still described category
patterns and delegation-target domains, contradicting the 0.2.0 release
note and packages/engine/src/compose.ts. Update the current contracts
and mark Spec 16 and ADR 0001 as amended. Say 'no direct replacement'
for patterns, since description and triggers now drive routing.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016wLPimWh3uHKyD8TdSzgC8

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
pgermishuys added a commit that referenced this pull request Sep 18, 2026
…ompts (#182)

Reverts the prompt half of #170. In real use the loops made Weave slow and
left agents running for hours: Tapestry would not finish until every plan
Verification check passed and re-delegated on each failure, Shuttle
reproduced-then-rechecked broader test suites, and Pattern attached a
verify-by command to every criterion that fed both loops.

Restores the pre-#170 Pattern, Shuttle, Tapestry, Weft, Warp and Loom
prompts (builtin and repo-local .weave overrides) while keeping later
changes (#167 plan-structure rules, #179 no-questions rules). The eval
cases, trajectory harness and harness fixes from #170 are kept. The
Copilot bundle is regenerated.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
pgermishuys added a commit that referenced this pull request Sep 22, 2026
…ve adapter (#216)

npm has exactly one version of `@weaveio/weave-adapter-opencode2`: 0.1.0,
cut at 29393cf. `package.json` has since said 0.1.1 and 0.1.2, but neither
was ever tagged, so neither was published.

At 29393cf there was no `src/v2/` directory. The published package's
exports confirm what it predates — only `.` and `./server`, no `./rpc` and
no `./tui`. Unreleased since then: agent materialization in plugin setup
(#163), real-CLI verification (#164), the whole native core integration
(#167) with its catalog-backed agents, `/weave:start`, plan RPC, TUI,
config refresh and native delegation, and #214/#215.

Every capability documented in docs/adapters/opencode2-core.md describes
code that has never been on npm. A user running `weave init --harness
opencode2` gets the bare package name, which resolves to 0.1.0.

This bumps the package to 0.2.0-next.0. The `-next.N` suffix publishes to
the `next` dist-tag, so `latest` stays on 0.1.0 and no existing install is
upgraded; the release is opt-in until it has been used against a real host.

Also adds the changeset #215 landed without, and lists the OpenCode 2
adapter in RELEASING.md's tag table. The publish workflow has accepted
`opencode2@*` tags since it was written; only the documentation omitted it,
which is the likeliest reason this package was never released.

No source change. The tag is not pushed here.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
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.

2 participants