You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
v2: normalize or reject unprefixed AI SDK packages in native provider config #44881
Native V2 provider configuration accepts an AI SDK npm package without the required aisdk: prefix, but the resulting provider fails only when a prompt is sent. This makes a plausible configuration silently select the native OpenCode provider loader instead of AI SDK compatibility.
The same issue applies to model-level package overrides. Legacy V1 provider.*.npm and model-level provider.npm values are automatically normalized during migration, and models.dev packages are also normalized, so native V2 config behaves inconsistently with those sources.
Current implementation
packages/core/src/config/plugin/provider.ts copies provider-level and model-level package values directly into the catalog.
packages/core/src/provider.ts recognizes AI SDK packages only when prefixed with aisdk:.
packages/core/src/model-resolver.ts treats every unprefixed package as a native OpenCode provider module.
V2 provider and model config schemas currently accept the invalid-looking-but-runtime-broken bare AI SDK strings.
Expected behavior
Native V2 configuration should either normalize obvious AI SDK package names such as @ai-sdk/* at both provider and model levels, or reject them early with an actionable validation error explaining the required aisdk: prefix. The public V2 provider documentation should explain native versus AI SDK package selection.
Preserve legitimate unprefixed native provider modules and native file:// packages; arbitrary third-party AI SDK packages may still need an explicit discriminator.
Partly done in #48943: bare AI SDK package names that are in the native map (e.g. @ai-sdk/openai-compatible) are now rewritten to the native package (aisdk-native.ts). Bare @ai-sdk/* names that aren't in the map still fail only at prompt time rather than when config loads. Closing this tracker.
Activity
neriousy commentedon Oct 22, 2026
Partly done in #48943: bare AI SDK package names that are in the native map (e.g.
@ai-sdk/openai-compatible) are now rewritten to the native package (aisdk-native.ts). Bare@ai-sdk/*names that aren't in the map still fail only at prompt time rather than when config loads. Closing this tracker.