Repository navigation
fix(sap-ai-core): serve the spec v3 provider entrypoint - #14509
jerome-benoit wants to merge 1 commit into
Conversation
|
No actionable findings. |
The `-v2` facade publishes AI SDK provider spec v2 payloads: `finishReason` a string, `usage` flat. AI SDK 6 consumers read the spec v3 object and nested totals, so opencode v2.4.1 fails every step with `Error: Schema validation failed` and drops token usage (packages/core/src/aisdk.ts:845,879-892 at 6f05140). The root entrypoint publishes spec v3 behind the same factory name, settings type and callable provider, so nothing else moves. Reported in jerome-benoit/sap-ai-provider#342, closed with this swap as the workaround. `bun run v1:check upstream/dev` reports this `npm` value as its only change.
782c224 to
8d5bd90
Compare
|
No actionable findings. |
|
Holding this for now. The swap itself is right (the root entry of
Released v1.19.6 does the same in I'll pick this up again once OpenCode recognizes both package names. |
|
Holding noted - the OpenCode side has landed. anomalyco/opencode#67848 ( Gate: the fix is not in any published tag yet (latest release is v2.4.4, 2026-12-03, which predates anomalyco/opencode#67849 mirrors the change onto the The patch still applies cleanly on current |
Change
providers/sap-ai-core/provider.toml:npm→@jerome-benoit/sap-ai-provider.packages/core/src/generate-v2.ts: same key inDEFAULT_NPM_BASE_URLS, looked up by providernpm(:426,492).Why
opencode v2.4.1 reads
finishReason.raw/.unifiedandusage.inputTokens.total(packages/core/src/aisdk.ts:845,879-892,895at 6f05140). Against-v2every step ends inError: Schema validation failed(StepFinish.make,packages/ai/src/schema/events.ts:269-270,374-377) and token usage resolves to nothing. Reported as jerome-benoit/sap-ai-provider#342, closed with this swap as the workaround.The root entrypoint is what such consumers read. Same factory name, same settings type, callable provider: nothing else moves.
-v2stays published for explicit pins.v1
One field. Needs maintainer approval.
Verification
bun validateexit 0 ·bun run v1:check upstream/devgives only the line above ·bun run testinpackages/sdk25 pass · generated v2 output:sdk.aisdkflips,${AICORE_DEPLOYMENT_URL}still resolves 51 times before and after.