Version Packages#490
Merged
Merged
Conversation
edcaa35 to
9b1e4db
Compare
9b1e4db to
8f3bea7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
82e8014Thanks @robert-j-y! - AddstructuredOutputs.strictsetting to opt out ofresponse_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: truewhenever 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 likemoonshotai/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:
The default remains
strict: truefor backward compatibility.Patch Changes
#485
bf664b1Thanks @robert-j-y! - FixsupportedUrls['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
bb2d4cbThanks @0age! - fix: stop emitting duplicatetool-callevents when a trailing-whitespace argument delta arrives after a complete tool callIn the streaming chat handler, the merge-into-existing-tool-call path enqueues a
tool-callstream event whenever the accumulatedfunction.argumentsis parsable JSON. BecauseJSON.parseaccepts trailing whitespace, any subsequent argument delta for the same tool-callindex(e.g. a stray space, newline, or closing-token chunk) leaves the arguments parsable and would re-trigger the emit, producing a secondtool-callevent with the sametoolCallId. Downstream tool runners (e.g. Vercel AI SDKstreamText) then execute the tool twice. Observed in production withmoonshotai/kimi-k2.6via OpenRouter, where the user-visible effect was every outbound message being delivered twice.src/chat/index.ts:tool-callemit is now gated on!toolCall.sent, mirroring the new-path behavior. Thesentflag was already being set after the first emit but was never read on this path.src/chat/index.test.ts:indexand asserts exactly onetool-callevent is emitted.