Repository navigation
fix: opencode pinned plugin entry + lane self-update by re-pin (#1108, revives #1143) - #1354
ranxianglei wants to merge 4 commits into
Conversation
…rom local cache (#1108) A bare npm spec makes opencode's managed plugin service re-resolve @latest against the npm registry at every boot; on slow networks that pushes cold start past the health-check window and the supervisor respawn-loops. Write "billion-context@<self-version>" instead (bare-name fallback when the version is unknown), recognize both forms everywhere the entry is matched, and have the update lane report stale pins instead of the generic opencode-managed hint.
#1108) Install pins the installing bili's version (sync, offline — equals npm latest in the normal just-installed flow); `bili plugin update opencode` now resolves the newest registry version and re-pins the entry in place (only the entry string — the opencode-managed package copy stays opencode's, #991). Foreign entries preserved verbatim (#1002).
… check (#1108) The spawned proxy runs startAutoUpdate like any install; its checkForUpdate currently early-returns for host-managed copies without even looking at the registry, so a pinned entry would freeze the opencode lane forever. In the refusal branch (owner opencode) resolve the newest registry version and re-pin the config entry instead — opencode's own manager fetches that version at next boot, from local cache afterwards. The copy itself stays opencode's (#991); the hook lives entirely inside the refusal branch and never touches the check/download/extract/install path, and every failure is caught and logged.
…in self-update (#1108) The gate the maintainer asked for on PR #1143: publish old/new versions to the local verdaccio, then verify on the real chain that (a) plugin install writes the exact-version entry (and is idempotent), (b) an opencode-managed old copy's update check re-pins the entry instead of writing itself, and (c) the exact spec resolves from local cache with --offline, byte-identical to the registry tarball. Replaces the TODO(#1143) master-semantics assertions.
📦 Built Package ArtifactBranch: Option A — Install from npm PR tag (recommended)npm install -g billion-context@pr-1354Each push to this PR publishes a new version under the Option B — Download artifact
tar xzf billion-context-pr1354.tgz
npm install -g packageInstall instructions are refreshed on each push. |
|
[bot] 🏷 Closing this as an exact duplicate of #1363 — same fix, same tree, same base. Duplicate screening (per AGENTS.md)
Review verdict (applies equally to #1363 — identical content)Verified on this head: typecheck clean; full suite 2643 pass / 0 fail / 11 skipped (gated e2e); build OK; targeted opencode tests 23/23; CI 11/11 green. Code review finds no regressions: the auto re-pin lives inside the host-managed refusal branch, never throws, never downgrades, and never writes the opencode-owned copy (#991 intact). Tests have real teeth on every changed behavior, including negative cases (dev-checkout refusal, unknown version, scoped-lookalike rejection, fetch failure) and the real verdaccio chain proving the copy stays byte-untouched while the entry re-pins. Release note for the human: this touches Merging remains a human decision either way. |
[bot] 🏷 Reviewed this PR (agent work — verified, did not redo it) and found it is an exact duplicate of #1363. Action taken: commented on #1354, closed it, and tagged both items Duplicate screening
Review verdict (applies equally to #1363)Verified on head
Behavior changes (old → new, per reporting policy)
Release gate (human decision)Per AGENTS.md §5/§7.4 this must stay human-merge — it touches 中文摘要:#1354 与 #1363 是同一修复的字节级相同重复项,已按规则关闭 #1354 并打「重复」标签;内容本身审查通过(方向、回归、代码、测试、diff 均无问题),可走发布流程——先出 no-op 验证版再合并 #1363(人工合并)。 |
Revives closed PR #1143 (same branch, rebased; GitHub refuses to reopen a PR after its branch is force-pushed). Fixes #1108.
What (unchanged from #1143's reviewed design)
bili plugin install opencodewrites the plugin entry as an EXACT version (billion-context@0.1.x) instead of the bare spec — every boot resolves from local cache; the bare spec re-resolves @latest at boot, which is the [opencode 2.x] bare npm spec ("billion-context") triggers managed-service restart loop; pinning an exact version avoids it #1108 restart-loop trigger on opencode 2.x.managed.owner === "opencode") re-pins the config entry to the newest registry version viarepinOpencodeLaneIfNewer— opencode's own manager fetches that version at next boot, from local cache afterwards.New in this revival
The gate the maintainer set in #1143's hold note — the #1153 hermetic local-registry harness landed via #1161, so the demanded e2e regression now exists (commit 8f22724,
tests/e2e/e2e-registry.test.ts):plugin install opencodewritesbillion-context@<new>and is idempotent on re-run;updaterefuses in-place self-update (log:install dir is managed by opencode), leaves the on-disk copy byte-untouched at the old version, and re-pins the config entry to the new version;npm pack --offline(cache-only) to a byte-identical tarball — the boot-locality mechanism of [opencode 2.x] bare npm spec ("billion-context") triggers managed-service restart loop; pinning an exact version avoids it #1108, zero registry round-trips.ACP_TEST_REGISTRY=1).Rebase notes:
src/update.tsconflict vs master's #1196 dsh-lane refresh resolved as a union (opencode re-pin + dsh refresh both inside the refusal branch, guardedmanaged && installDir).Unit tests:
tests/plugin-install-opencode.test.ts+tests/update-opencode-repin.test.ts28/28 green, typecheck clean.Merging is a human decision per AGENTS.md.