Skip to content

fix(v2): load the provider package at the plugin's own version - #129

Merged
justin-carper merged 1 commit into
mainfrom
fix/v2-provider-pin
Sep 29, 2026
Merged

justin-carper merged 1 commit into
mainfrom
fix/v2-provider-pin

Conversation

@justin-carper

Copy link
Copy Markdown
Collaborator

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 clean XDG_CACHE_HOME, v2 resolved that to npm/@stablekernel/opencode-cursor@latest/ (0.9.0), not the running plugin's version. A user testing @next would silently get the latest provider. Every earlier v2 smoke forced OPENCODE_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_NPM still overrides. providerNpm() gains an optional fallback argument; v1 callers pass none and are unchanged.

Verified: npm test 642 passed, typecheck and build exit 0. The built dist/plugin/index.js setup() registers aisdk:@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.

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.
@justin-carper
justin-carper merged commit 62802ca into main Sep 29, 2026
8 checks passed
@justin-carper
justin-carper deleted the fix/v2-provider-pin branch September 29, 2026 16:08
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