Repository navigation
fix(core): accept both sap-ai-provider package names - #67848
Conversation
Preserve SAP reasoning options, variants, and URL handling when models.dev switches to the unsuffixed, V3 provider package.
There was a problem hiding this comment.
Looks good. With the PR's tests run against the base source, the three new SAP checks fail; with this change they pass: the options key, the reasoning variants and the catalog base-URL check, for both package names (90/90 in the core test files you listed). typecheck:tsc for packages/core passes too. I couldn't test against a real SAP AI Core deployment because there are no credentials here.
Public API: unchanged. The new SAP_AI_CORE_PACKAGES constant is internal to core.
No concerns.
Related: #66153
There was a problem hiding this comment.
The new commit only updates the provider-option test so the SAP cases use SAP's real modelParams.reasoning_effort setting. It passes for both package names, and aisdk, variant and provider tests plus typecheck:tsc pass. No source code changed since the last review, and I have no concerns.
Public API: unchanged.
Issue for this PR
Related to #66153 and anomalyco/models.dev#14509. This does not close the V2 stream issue.
Type of change
What does this PR do?
If models.dev switches to the unsuffixed SAP package today, Core puts reasoning options under the provider ID instead of
sap-ai. Both package names now share thesap-aioptions key, SAP reasoning variants, and catalog base URL exclusion. No flag or catalog change is needed.Core loads the unsuffixed package root (
.), which returns a V3 model. #66164 adapts legacy V2 models to V3; it is not needed for this entrypoint. This PR leaves the legacy loader and V2 stream behavior unchanged.The
v1publish workflow still has a release path, and npmlatestis 1.19.6. Backport: #67849.How did you verify your code works?
bun run script/test.ts test/aisdk.test.ts test/variant.test.ts test/provider.test.ts test/plugin/models-dev.test.ts test/plugin/provider-sap-ai-core.test.ts— 90 passed. The request test checks SAP's actualmodelParams.reasoning_effortfield for both package names.bun run typecheck— 37 tasks passed.bun run --cwd packages/core typecheck:tscpassed.bun run lint:changedand direct Oxlint on the changed Core TypeScript files passed. The pre-pushbun run checkalso passed.Screenshots / recordings
Not a UI change.
Checklist
Added by the opencode bot (AI-generated).
Related: #66153