Repository navigation
Open
Labels
Description
Summary
Every client startup fails to install the opencode-sdd-engram-manage TUI plugin (npm registry package, unversioned entry in cli.json plugins → @latest = 1.7.0) with NpmInstallFailedError — an error with an empty message in the logs. The real cause (unable to resolve dependency tree at Npm.reify) only surfaces through opencode plugin add / update stderr. The identical manifest installs fine with system npm, and version 1.6.8 — with byte-identical peerDependencies/engines metadata — installs fine through OpenCode itself. The tree is resolvable; the failure looks like per-spec resolver/cache state inside OpenCode's internal npm client.
Environment
- opencode version: v2.0.10 (also reproduces on v2.0.8)
- OS: Linux 7.0.0-31-generic x86_64 (Ubuntu-based)
- Terminal: TERM=xterm-256color, COLORTERM=truecolor (desktop app and TUI clients both affected)
- Shell: /bin/bash
- Install/channel:
latest(client auto-updated 2.0.8 → 2.0.10 mid-session; server on 2.0.10) - Active plugins: TUI (
cli.jsonplugins):opencode-subagent-statusline1.3.0 (healthy), localgentle-logo.tsx(healthy),opencode-sdd-engram-manage(the failing one; now pinned@1.6.8as workaround). Server: 92 plugins active, including 6 local plugins.
Reproduction
opencode plugin add opencode-sdd-engram-manage→ fails:NpmInstallFailedError: at Npm.reify (...) at Npm.add (...) at cli.plugin.add (...) [cause]: Error: unable to resolve dependency tree- In an empty directory:
echo '{"dependencies":{"opencode-sdd-engram-manage":"1.7.0"}}' > package.json && npm install→ succeeds (131 packages; npm 11.19.0, node v24.20.0; onlyEBADENGINEwarnings for@opentui/core). opencode plugin add [email protected]→ succeeds through the same OpenCode code path.
Expected Behavior
- The internal installer resolves the same dependency tree that npm resolves (or reports the specific conflict).
- When an install fails, the underlying cause is visible in CLI output and reconciliation logs — not an empty
NpmInstallFailedError.
Actual Behavior
- Deterministic failure at every client startup reconciliation (~180–470 ms,
stage=prepare,install=true):with no message or cause, even withlevel=WARN message="plugin operation failed" component=plugin stage=prepare durationMs=236 error=NpmInstallFailedError reconciliation=1 target=opencode-sdd-engram-manage install=true role=cliOPENCODE_LOG_LEVEL=DEBUG. opencode plugin updatereports[cause]: Error: Package is not installed: opencode-sdd-engram-manage.- The workspace
~/.cache/opencode/npm/opencode-sdd-engram-manage@lateststays completely empty — the<epoch-ms>staging directory is never created. A healthy plugin's workspace (opencode-subagent-statusline@latest) contains<epoch-ms>/package.json({"dependencies":{"opencode-subagent-statusline":"1.3.0"}}) and<epoch-ms>/node_modules/. - The failure persisted across: v2.0.8 → v2.0.10, service restarts, and deleting the workspace directory (OpenCode recreated it empty and failed again).
Additional Context
- Package metadata for 1.6.8 vs 1.7.0 is byte-identical for
peerDependencies/engines(a diff ofnpm view --jsonshows only tarball hash/size/gitHead). Peers:solid-js: 1.9.12(exact pin),@opentui/core|solid|keymap: >=0.4.2 <1,@opencode-ai/plugin: >=1.17.11; engines:node: >=24 <25,opencode: >=1.17.11. The latest@opentui/*is 0.5.11, whose own peers are compatible (@opentui/[email protected]→solid-js: 1.9.12). - Since 1.6.8 installs via OpenCode and 1.7.0 does not, with identical resolution metadata, the defect appears to be per-spec state inside OpenCode's internal npm client (resolver or cache), not the package's metadata.
- Two distinct problems: (1) the resolver failing on a resolvable spec; (2) observability — the empty
NpmInstallFailedErrorhides the cause from the logs entirely. - Workaround that restored a clean startup:
opencode plugin add [email protected](pinned entry) +opencode plugin remove opencode-sdd-engram-manage(drop the unversioned entry).
Activity
CENFARG commentedon Oct 16, 2026
Cross-platform + current-version data point confirming this (Windows 11, opencode 2.0.30, node 24.14.1):
cli.jsonfails identically:NpmInstallFailedError (cause: Error: unable to resolve dependency tree)atNpm.reify, reconciling on every start.[email protected]and@1.6.8(exact) both install fine through OpenCode — so only the tag spec path fails, matching your 1.6.8 observation and extending it to the latest release.@npmcli/[email protected], empty staging dir,reify({add: [spec]}, audit:false, ignoreScripts:true, binLinks:true, save:true)+@npmcli/[email protected]defaults): the tag spec succeeds standalone under both Node 24.14.1 and Bun 1.4.2. Same registry cache, same manifests — which supports your per-spec resolver/cache state hypothesis inside OpenCode's bundled client.XDG_CACHE_HOME/XDG_CONFIG_HOMEsandbox (production config verified unchanged by hash).Happy to test any candidate fix on Windows.
diegoolherry commentedon Oct 20, 2026
Reproduces on Windows with opencode 2.1.1, so this is still present after the 2.0.x reports.
Environment:
latest, installed via npm (@opencode/cli)TERM_PROGRAM=WezTerm); shell: cmd.exe / PowerShellObserved:
opencode plugin add opencode-sdd-engram-manage->NpmInstallFailedError:with an empty message, exit 1.opencode plugin update opencode-sdd-engram-manageprintsNo plugin updates availablefollowed by the same empty error.NpmInstallFailedErroron both reconciliation passes (durationMs=2865, then285) fortarget=opencode-sdd-engram-manage install=true role=cli.{"dependencies":{"opencode-sdd-engram-manage":"1.7.0"}}+npm installsucceeds (131 packages, ~22s); onlyEBADENGINEwarnings for@opentui/[email protected](it requires node >=26.4.0, host has 24.11.1).~/.cache/opencode/npm/opencode-sdd-engram-manage@lateststays empty - no<epoch>staging directory is ever created - while the healthyopencode-subagent-statusline@latest/<epoch>/is populated normally withpackage.jsonandnode_modules/.~/.cache/opencode/packages/opencode-sdd-engram-manage@latestaside does not help; the next attempt fails again with the same empty error.opencode plugin add [email protected]succeeds, andopencode plugin checkthen exits 0 with both TUI plugins reported(current).This confirms the per-spec resolver/cache-state diagnosis: 1.7.0 fails and 1.6.8 installs through the same code path, and the pinned-1.6.8 workaround also works on Windows.
rudy500 commentedon Oct 22, 2026
Still reproduces on v2.1.2 (Windows) — this issue is the closest match, adding occurrence evidence.
opencode plugin add opencode-sdd-engram-manage(bare name → tag spec,dist-tag latest = 1.7.0) fails deterministically, exit 1, across multiple runs:error=NpmInstallFailedError target=opencode-sdd-engram-manage.opencode plugin add [email protected]succeeds through the identical code path (exit 0, cache generation created). The~/.cache/opencode/npm/opencode-sdd-engram-manage@latestworkspace stays empty — reproduces the empty-workspace observation above.npm install [email protected]with system npm succeeds in ~11s, so the tree is resolvable; same conclusion as the standalone arborist harness in the duplicate closed as plugin add with a tag spec (bare name / @latest) fails with ERESOLVE for some packages; exact version installs fine #56091."[email protected]"incli.jsonand drop the bare entry — with the bare entry kept, every TUI start retries and logs the failure again.Environment: opencode v2.1.2, Windows 11 (win32 x64), node v24.18.0, npm 12.2.0, registry
https://registry.npmjs.org/, empty user.npmrc.opencodejr commentedon Oct 28, 2026
Thanks for the detailed report. I can reproduce this on v2.0.10, and it still happens on the latest
dev(62ae125).It only affects the bare spec:
opencode plugin add opencode-sdd-engram-managefails with an emptyNpmInstallFailedError:and[cause]: Error: unable to resolve dependency tree.opencode plugin add opencode-sdd-engram-manage@latest,@1.7.0and@^1.7.0all install fine.It looks like the cause is not per-package cache state but how a bare name is resolved. The bun runtime OpenCode runs on reports its Node version as v26.x. A bare name is resolved as the range
*, and npm's version picker then skips versions whoseengines.node(>=24 <25, which 1.3.0 and later declare) rules out v26. It falls back to 1.2.0, which declares no node engine but has old peers (@opentui/core ^0.1.100). Those peers conflict with the current@opentui/core, and that's the ERESOLVE. A tag or exact version skips that path, which is why pinning 1.6.8 worked for you. In the meantime, an@latestentry instead of the bare name should also work.The empty error message is real too: the error class has no message of its own, so the CLI shows the cause only under
[cause]. I didn't test the startup-log path myself, but that would explain why your reconciliation logs show only the error name.The script below reproduces it.
Reproduction script (repro.sh)
Run it:
bash repro.sh