Skip to content

fetch:opencode: build from local fork clone pinned by git ref - #91

Merged
jack-champagne merged 3 commits into
aaron/problem-workspacesfrom
jack/opencode-local-source
Jul 8, 2026
Merged

fetch:opencode: build from local fork clone pinned by git ref#91
jack-champagne merged 3 commits into
aaron/problem-workspacesfrom
jack/opencode-local-source

Conversation

@jack-champagne

@jack-champagne jack-champagne commented Jul 7, 2026

Copy link
Copy Markdown
Member

The vendored opencode now builds from a local harmoniqs/opencode clone at a git ref pinned in opencode.lock.json, instead of trusting release binaries. This also fixes the bug that made the releases look broken: binaries built with the documented recipe hid every amicode UI surface (home cards, institution card, v2 titlebar) — see Channel gate below.

Lock (opencode.lock.json): source: "local" + ref = merged fork PR #1 head (ab0e798). repo/tag/platforms stay as the release fallback.

Fetcher (fetch_opencode.mjs):

  • Clone resolution: --local <path> > AMICODE_OPENCODE_SRC > sibling ../opencode.
  • Verifies clone HEAD == locked ref and tree is clean; --any-ref bypasses for iteration; --no-build reuses an existing artifact.
  • Runs the fork's build with OPENCODE_VERSION=<v> and OPENCODE_CHANNEL=dev (see below), bun dir prepended to PATH.
  • Stamps the actual binary sha256 + a .source provenance file (local <ref>[+dirty] / release <repo>@<tag>) — replaces the hand-swap workflow that left the stamp lying at the manifest value.
  • No clone present → warns and falls back to the pinned release, so CI needs no changes. Explicit --local/--release force a mode.

Channel gate (the release bug): OPENCODE_VERSION=1.17.3 (per the fork's AMICODE-PATCHES.md §3 recipe) forces Script.channel=latest → the web-UI embed compiles with VITE_OPENCODE_CHANNEL="prod" (app/vite.js) → settings.general.newLayoutDesigns defaults off (settings.tsx:55) → home.tsx:142 renders LegacyHome: all amicode surfaces hidden at runtime despite being compiled in. Confirmed in the bytes: release amicode.2 and the old recipe both inline the gate as false; with OPENCODE_CHANNEL=dev it inlines true. Every smoke layer (boot, /event, --version, title) passes either way, which is why no gate caught it. Follow-up: fix the recipe in the fork's AMICODE-PATCHES.md.

Verified: 14/14 fetcher tests; full suite 430 pass + 1 pre-existing stale-VSIX packaging failure (fails on clean tree too); real end-to-end on linux-x64 — clone at ab0e798 → build → smoke 1.17.3test:smoke PASS → gate constant !0 in the vendored binary; homepage cards confirmed rendering in the live extension (Jack).

Base is rchari/workbench (the fork-release machinery + amicode.2 pin aren't on main yet).

Lock gains source=local + ref (merged fork PR #1 head). The fetcher
builds from a harmoniqs/opencode clone (sibling ../opencode,
AMICODE_OPENCODE_SRC, or --local <path>) after verifying HEAD matches
the locked ref and the tree is clean (--any-ref to bypass), then stamps
the ACTUAL binary sha256 plus a .source provenance file — replacing the
hand-swap workflow that left the stamp lying at the manifest value.
No clone present (CI) → falls back to the pinned release download.
@jack-champagne
jack-champagne force-pushed the jack/opencode-local-source branch from 1e02667 to 91e3382 Compare July 8, 2026 00:19
@jack-champagne
jack-champagne changed the base branch from aaron/problem-workspaces to rchari/workbench July 8, 2026 00:19
Same source (ab0e798) as amicode.2, rebuilt with OPENCODE_CHANNEL=dev so
CI and clone-less installs get the amicode UI surfaces by default.
@jack-champagne
jack-champagne changed the base branch from rchari/workbench to aaron/problem-workspaces July 8, 2026 04:33
@jack-champagne
jack-champagne merged commit 829bb2e into aaron/problem-workspaces Jul 8, 2026
5 checks 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