fix(opencode): remove install-breaking upper bounds on shared deps - #12
Merged
Merged
Conversation
There was a problem hiding this comment.
All reported issues were addressed across 3 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 1 file (changes from recent commits).
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
`@opentui/*` was declared as a peer at `^0.4.5`. On a 0.x version that caret
means `>=0.4.5 <0.5.0`, so once OpenTUI released 0.5.0 the range stopped
matching what the host resolves. `@opencode-ai/plugin` declares the same
packages as optional peers at `>=0.4.5` and happily takes 0.5.x, leaving npm
with no satisfiable tree:
npm error Found: @opentui/core@0.5.1
npm error peer @opentui/core@"^0.4.5" from @cortexkit/opencode-antigravity-auth@2.0.0
The install aborts, so the plugin is simply absent — which surfaces to users as
`ProviderModelNotFoundError: Model not found: google/antigravity-*` rather than
as an install failure. Anyone whose plugin cache was rebuilt hit it.
Declare the OpenTUI packages as ordinary dependencies at `>=0.4.5` (the shape
the sibling openai-auth plugin already uses) and drop the `^1.17.13` ceiling on
the host plugin, which would have caused the same class of break at 2.x.
Add a manifest guard covering both halves of the failure. Statically: no range
we publish for one of the host's own peer dependencies may reject a future
version, since those must resolve to one shared copy. Against the installed
tree: exactly one distinct copy of each such package, satisfying our range and
the host's at once. The static half matters because a ceiling is wrong the day
it is written but stays green until the ecosystem crosses it — which is how
this reached users.
Copy detection scans one nested level (`node_modules/<dep>/node_modules/<name>`,
scoped owners included) as well as the ancestor chain, because npm parks a
forced duplicate under the dependent that caused it. Identity is `dev:inode`,
not path or realpath: Bun's store hardlinks packages, so realpath neither
collapses every alias nor separates two physically distinct files.
iceteaSA
force-pushed
the
fix/opentui-peer-range
branch
from
August 5, 2026 05:43
4731b29 to
a4761e7
Compare
ualtinok
pushed a commit
that referenced
this pull request
Aug 7, 2026
P3 #11: the e2e mock's quotaSummaryWindow fixture dropped fixture headers before writing the body. Apply them via the shared applyHeaders seam so cache-bust and trace-header tests have a path. P3 #12: the quota-manager 'back-compat' test loaded a windows-shaped fixture rather than exercising a windows-less legacy shape through the real read path. Rewire it through a hand-rolled RetrieveUserQuotaSummaryResponse that omits per-window data. P3 #13: account-manager 'remove-during-refresh' test never attempted the quota write, so the expectedRefreshToken guard wasn't exercised. Call updateQuotaCache(0, …, refreshTokenForA) after the removal so the assertion covers the actual cross-account guard. P3 #14: the sidebar-state 'half-missing stamp' test covered only the cachedQuotaAccountId-only case. Add the symmetric currentQuotaAccountId-only case so legacy snapshots missing the persisted stamp don't silently drop quota. P3 #15: account-command-oauth failure messages said 'Please try again' even though the pending entry was consumed and the same code could not be redeemed. Update the messages to 'start a new OAuth flow' so the operator knows the OAuth session is gone. P3 #16: tighten the account-command-oauth test assertions — pin the failed-exchange response, pin the full persisted success object (not just label), assert 'Work account' renders in the add-oauth-finish dialog, and restore an explicit unknown-key legacy fixture for the renderer. The tui-compiled mirror of command-data.ts is regenerated by the build:tui gate so the bundled TUI payload matches the source.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Installing 2.0.0 fails outright on a current host. Reported in Discord by two users; the trigger is anything that rebuilds the plugin cache (
rm -rf ~/.cache/opencode, a fresh machine, a new install).The failure does not look like a failure. npm aborts, the plugin is never installed, and the user sees:
Cause
2.0.0 declared
@opentui/*as peer dependencies at^0.4.5. On a0.xversion, caret is minor-locked —^0.4.5means>=0.4.5 <0.5.0. OpenTUI has since released 0.5.0 and 0.5.1.@opencode-ai/plugindeclares the same three packages as optional peers at>=0.4.5, so the host resolves 0.5.1 happily. Our range rejects it, and no single version satisfies both — hence ERESOLVE.This was a 2.0.0 regression. 1.1.0 declared neither the OpenTUI peers nor a host-version ceiling.
Fix
Match the shape the sibling
openai-authplugin already uses:"peerDependencies": { - "@opencode-ai/plugin": "^1.17.13", - "@opentui/core": "^0.4.5", - "@opentui/keymap": "^0.4.5", - "@opentui/solid": "^0.4.5", + "@opencode-ai/plugin": "*", "typescript": "^5 || ^6" }, "dependencies": { + "@opentui/core": ">=0.4.5", + "@opentui/keymap": ">=0.4.5", + "@opentui/solid": ">=0.4.5",The
^1.17.13ceiling on the host goes too. It is not biting yet — 1.18.11 satisfies it — but it is the same defect one major bump away, and both sibling plugins use*.I also tested keeping the OpenTUI packages as peers marked
optional. That installs cleanly but leaves them uninstalled, and the./tuientry then fails to import. Ordinary dependencies is the correct shape for a package that imports them at runtime.engines.opencodestill reads>=1.17.13 <2. Left alone deliberately: it is advisory rather than resolver input, so it does not cause this failure, and tightening or loosening it is a separate call.Verification
Installed the packed tarball against the exact host from the report:
npm lsshows one hoisted copy —@opentui/core@0.5.1with keymap and solid bothdeduped, so no duplicate runtime.Gates: 1830 unit / 0 fail · 28 e2e / 0 fail · typecheck · format · lint ·
build·smoke:tui.Regression guard
packages/opencode/src/package-manifest.test.tsfails when any range we publish for one of the host's own peer dependencies rejects a future version, since those must resolve to a single shared copy. It reads the host manifest from the installed tree rather than hardcoding a version, and asserts directly that 0.4.5 / 0.5.0 / 0.5.1 / 1.0.0 are all accepted.Restoring the 2.0.0 ranges turns all three tests red:
The host's ordinary
dependenciesare deliberately not flagged — those can nest a second copy, so a bound there is not an install hazard. Scoping to peers only was a correction: the first version of the guard flaggedzodand would have been wrong.For affected users before a release
or
legacy-peer-deps=truein.npmrc. Both verified — the plugin installs and the server entry loads.This needs a patch release to reach anyone; the fix has no effect until 2.0.1 is on npm.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by cubic
Fix npm install failures on fresh hosts by removing upper bounds on shared OpenTUI packages and making them direct dependencies. Adds a guard test to block future ceilings and duplicated installs so one version is shared with the host.
@opentui/core,@opentui/keymap,@opentui/solidfrom peerDeps^0.4.5to deps>=0.4.5to allow 0.5.x+ and match the host.@opencode-ai/pluginpeer range to*.package-manifest.test.tsto fail on any ceilings, assert OpenTUI0.4.5/0.5.x/1.xare accepted, and verify exactly one installed copy across ancestor and nested trees (hardlinks handled).Written for commit a4761e7. Summary will update on new commits.