fix: Moonshot structured outputs reject compatible schemas and omit strict validation (#19607)
## Background Moonshot rejected valid AI SDK structured-output tuple schemas with HTTP 400 because requests used an incompatible schema shape and did not enable documented strict validation. ## Root Cause Moonshot response schemas bypassed the existing MFJS normalizer used for tool schemas, omitted the strict field, and included an undocumented description field; captured requests and regression tests confirmed these payload defects. ## Summary Normalized Moonshot response schemas through the MFJS compatibility layer, defaulted strict validation to true with a strictJsonSchema opt-out, removed the undocumented payload member, and updated documentation, example, and patch changeset. ## Testing Added request-shape regression coverage for normalization, default strict mode, strict opt-out, description omission, and unchanged JSON-object fallback, plus exported provider-option type coverage. ## End-to-end Validation - `pnpm --filter @ai-sdk/moonshotai build && git show HEAD:examples/ai-functions/src/reproduction/issue-19544-moonshot-structured-output.ts | pnpm -C examples/ai-functions exec tsx -` — the live Moonshot structured-output request succeeded and verified strict opt-out and JSON-object fallback. ## Related Issues Fixes #19544 Closes #19592 --------- Co-authored-by: ai-sdk-factory <308175966+ai-sdk-factory@users.noreply.github.com> Co-authored-by: gr2m <39992+gr2m@users.noreply.github.com>
A
ai-sdk-factory[bot] committed
462c49855db8500c2e84fa3d07bb2ea228989d3b
Parent: 9645259
Committed by GitHub <noreply@github.com>
on 8/25/2026, 10:58:39 PM