Skip to content

build: package a pinned OpenCode v2 experiment - #8

Merged
EricWvi merged 3 commits into
ora-space:mainfrom
wanglongan587:build/297-opencode-v2-probe
Oct 21, 2026
Merged

EricWvi merged 3 commits into
ora-space:mainfrom
wanglongan587:build/297-opencode-v2-probe

Conversation

@wanglongan587

@wanglongan587 wanglongan587 commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Package an explicitly pinned OpenCode 2.0.32 prerelease and start ACP using the host process working directory. V2 rejects the former --cwd argument before the ACP handshake.

pinned npm platform package → SHA-512 verification → .orax
host cwd → opencode acp → unchanged ACP bridge

Adds npm archive support while retaining GitHub Release packaging, and lets the host simulator exercise an extracted package. Version: 0.7.0-opencode2.1. No marketplace update or release is included.

Refs ora-space/circus#297

ADR status: no ADR behavior change. Packaging and CLI invocation preserve the existing host-owned process/ACP boundary. Host history and UI changes are outside this PR; this prerelease does not complete the shared runtime ADR or the approved plugin-owned model adapter ADR.

Rebased onto main e518360

Rebased over #11 (the Agent declaration behind --agent-configuration). The two changes compose instead of replacing each other: buildBundledPackage keeps both includeDeclaration and npmAsset, and the call site passes includeDeclaration together with pinned.npm. Packaging without the flag is unchanged; with the flag the declaration is still staged into every package, read back, and bound into dist/manifest.toml.

Evidence

  • Before: the v2 CLI exits with Unrecognized flag: --cwd, so ACP initialize times out.
    After: packaged entrypoint passes initialize, session creation, model discovery, Effect coordination/readiness/restart, and stop in the host simulator.
  • On the rebased head: deno task check, deno task lint, deno test scripts/upstream.test.ts (archive integrity), deno task test (packaging), and deno task sync --check (upstream.lock.json is current: anomalyco/opencode@2.0.32) pass, and GitHub Actions CI is green.
  • All four target packages rebuilt from the pinned npm archives after the rebase, each archive verified against its pinned SHA-512 before extraction. In the earlier round Ora's production local installer accepted each declared target, and the Windows installed binary reported opencode v2.0.32.
  • Live model probes through the plugin cover concurrent and nested child projection and cancellation. Linux/macOS binaries have not been executed on their native hosts; full Desktop/Cloud workflow acceptance remains outside this packaging PR.

Merge Danger

Door: two-way

Blast Radius: packaging

Merging changes the bundle configuration to an explicit v2 prerelease pin; nightly synchronization will check that fixed npm version instead of following new v1 GitHub releases. Publishing or replacing the marketplace package requires a separate release decision. Host history must preserve metadata before child text can reliably survive reload.

@ObsisMc ObsisMc left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving at 4cc6d860c82a91d296f1d81fcc92e9f7783b3120.

Checked:

  • Every changed file is a deliverable (code, tests, CI, README, lock, version); no tag, release, or marketplace change.
  • ADR status is stated (no ADR behavior change; the shared runtime and plugin-owned model adapter ADRs are not completed here).
  • npm pinning: resolveNpmUpstream requires each platform package to be listed in the parent's optionalDependencies at the same version, with a registry.npmjs.org tarball and a well-formed SHA-512 SRI. Packaging verifies the SRI before writing or extracting, and rejects lock/config drift or mixed npm/GitHub integrity sources. Network access for package is limited to registry.npmjs.org.
  • --cwd removal: both spawn sites now run opencode acp with the host-provided cwd; no extra spawn path. Model discovery's existing session/delete capability check matches the new README note.

Non-blocking:

  1. Merging switches main to the v2 experiment. With a fixed npm pin, nightly sync --check always reports current, so v1 users stop receiving upstream updates, and a 0.6.x hotfix can no longer be cut from main. Whether and when this lands on main is a maintainer decision; the Merge Danger section already notes it.
  2. Stale comments for the npm path in scripts/package.ts: the digest comment still refers to GitHub's Releases API, and the extraction comment still says the CLI is the sole entry at the archive root. The header of .github/workflows/upstream.yml ("Watches GitHub releases") is also outdated.
  3. upstream.yml's patch bump does $((PATCH + 1)), which fails on a suffixed version like 0.7.0-opencode2.1. It only runs when the lock is behind the config, so it is unreachable today.
  4. The summary calls OpenCode 2.0.32 a "prerelease"; the prerelease is the plugin version (0.7.0-opencode2.1). Worth wording precisely.

@EricWvi
EricWvi merged commit 8de5860 into ora-space:main Oct 21, 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.

3 participants