fix(v2): load the provider package at the plugin's own version - #129
Merged
Merged
Conversation
v2 registers the provider as `aisdk:<npm spec>`. The bare `@stablekernel/opencode-cursor` spec resolved to `latest`, so a plugin installed from `@next` loaded the `latest` provider (verified with a clean cache: 0.9.0 was loaded). Pin the spec to the running plugin's version; OPENCODE_CURSOR_PROVIDER_NPM still overrides. v1 is unchanged.
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.
Follow-up to #127, found while checking the published-package path for the pre-release.
Problem: v2 registers the provider as
aisdk:${providerNpm()}, which defaulted to the bare@stablekernel/opencode-cursor. With a cleanXDG_CACHE_HOME, v2 resolved that tonpm/@stablekernel/opencode-cursor@latest/(0.9.0), not the running plugin's version. A user testing@nextwould silently get thelatestprovider. Every earlier v2 smoke forcedOPENCODE_CURSOR_PROVIDER_NPM=file://…, which hid this.Fix: the default spec is now
@stablekernel/opencode-cursor@<plugin version>(version inlined at build time; falls back to the bare name if it is not valid semver).OPENCODE_CURSOR_PROVIDER_NPMstill overrides.providerNpm()gains an optional fallback argument; v1 callers pass none and are unchanged.Verified:
npm test642 passed, typecheck and build exit 0. The builtdist/plugin/index.jssetup()registersaisdk:@stablekernel/opencode-cursor@0.10.0-next.0. I also confirmed in a clean cache that a pinned spec (@0.9.0) makes v2 load that exact version and chat.Not verified: a v2 chat with the pin and no override. The pinned version has to be published first, so that check is only possible after release.