Skip to content

Version Packages#490

Merged
robert-j-y merged 1 commit into
mainfrom
changeset-release/main
Apr 28, 2026
Merged

Version Packages#490
robert-j-y merged 1 commit into
mainfrom
changeset-release/main

Conversation

@github-actions

@github-actions github-actions Bot commented Apr 28, 2026

Copy link
Copy Markdown
Contributor

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and publish to npm yourself or setup this action to publish automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.

Releases

@openrouter/ai-sdk-provider@2.9.0

Minor Changes

  • #486 82e8014 Thanks @robert-j-y! - Add structuredOutputs.strict setting to opt out of response_format.json_schema.strict (issue response_format.json_schema.strict is hardcoded to true, breaks routing for models whose providers don't support strict mode #483).

    Previously the SDK hardcoded strict: true whenever a JSON schema response format was used, which made it impossible to route requests to providers that don't advertise support for strict json_schema. Models like moonshotai/kimi-k2.6 (routed through Parasail/Venice/Io Net) returned HTTP 404 "No endpoints available matching your guardrail restrictions and data policy" because the strict flag eliminated every eligible endpoint.

    Users can now opt out per-model:

    const model = openrouter.chat("moonshotai/kimi-k2.6", {
      structuredOutputs: { strict: false },
    });

    The default remains strict: true for backward compatibility.

Patch Changes

  • #485 bf664b1 Thanks @robert-j-y! - Fix supportedUrls['image/*'] regex to accept image URLs with query strings or fragments (e.g. https://cdn.example.com/photo.png?height=200, .../photo.webp#frag). Previously the $ anchor on the extension caused such URLs to be treated as unsupported, forcing the AI SDK runtime to download and base64-inline them, which bloated conversation history and inflated token usage.

  • #489 bb2d4cb Thanks @0age! - fix: stop emitting duplicate tool-call events when a trailing-whitespace argument delta arrives after a complete tool call

    In the streaming chat handler, the merge-into-existing-tool-call path enqueues a tool-call stream event whenever the accumulated function.arguments is parsable JSON. Because JSON.parse accepts trailing whitespace, any subsequent argument delta for the same tool-call index (e.g. a stray space, newline, or closing-token chunk) leaves the arguments parsable and would re-trigger the emit, producing a second tool-call event with the same toolCallId. Downstream tool runners (e.g. Vercel AI SDK streamText) then execute the tool twice. Observed in production with moonshotai/kimi-k2.6 via OpenRouter, where the user-visible effect was every outbound message being delivered twice.

    src/chat/index.ts:

    • Merge-path tool-call emit is now gated on !toolCall.sent, mirroring the new-path behavior. The sent flag was already being set after the first emit but was never read on this path.

    src/chat/index.test.ts:

    • Adds a regression test that streams a complete tool call followed by a trailing-whitespace-only argument delta for the same index and asserts exactly one tool-call event is emitted.

@github-actions github-actions Bot force-pushed the changeset-release/main branch from edcaa35 to 9b1e4db Compare April 28, 2026 19:09
@github-actions github-actions Bot force-pushed the changeset-release/main branch from 9b1e4db to 8f3bea7 Compare April 28, 2026 19:58
@robert-j-y robert-j-y merged commit 5cef3c5 into main Apr 28, 2026
@robert-j-y robert-j-y deleted the changeset-release/main branch April 28, 2026 20:41
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