Skip to content

Commit 8f3bea7

Browse files
Version Packages
1 parent bb2d4cb commit 8f3bea7

5 files changed

Lines changed: 35 additions & 38 deletions

.changeset/fix-issue-484-image-url-query-params.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/fix-streaming-merge-path-duplicate-tool-call.md

Lines changed: 0 additions & 15 deletions
This file was deleted.

.changeset/issue-483-structured-outputs-strict.md

Lines changed: 0 additions & 17 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,39 @@
11
# @openrouter/ai-sdk-provider
22

3+
## 2.9.0
4+
5+
### Minor Changes
6+
7+
- [#486](https://github.com/OpenRouterTeam/ai-sdk-provider/pull/486) [`82e8014`](https://github.com/OpenRouterTeam/ai-sdk-provider/commit/82e8014d2f82325db64e5eb6bf99a0cf781dafef) Thanks [@robert-j-y](https://github.com/robert-j-y)! - Add `structuredOutputs.strict` setting to opt out of `response_format.json_schema.strict` (issue #483).
8+
9+
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.
10+
11+
Users can now opt out per-model:
12+
13+
```ts
14+
const model = openrouter.chat("moonshotai/kimi-k2.6", {
15+
structuredOutputs: { strict: false },
16+
});
17+
```
18+
19+
The default remains `strict: true` for backward compatibility.
20+
21+
### Patch Changes
22+
23+
- [#485](https://github.com/OpenRouterTeam/ai-sdk-provider/pull/485) [`bf664b1`](https://github.com/OpenRouterTeam/ai-sdk-provider/commit/bf664b188e773cbe78c12a3f674062e2f6d86082) Thanks [@robert-j-y](https://github.com/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.
24+
25+
- [#489](https://github.com/OpenRouterTeam/ai-sdk-provider/pull/489) [`bb2d4cb`](https://github.com/OpenRouterTeam/ai-sdk-provider/commit/bb2d4cb254c1d69dbafd615aba96ff28b2b4261f) Thanks [@0age](https://github.com/0age)! - fix: stop emitting duplicate `tool-call` events when a trailing-whitespace argument delta arrives after a complete tool call
26+
27+
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.
28+
29+
**`src/chat/index.ts`:**
30+
31+
- 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.
32+
33+
**`src/chat/index.test.ts`:**
34+
35+
- 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.
36+
337
## 2.8.1
438

539
### Patch Changes

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@openrouter/ai-sdk-provider",
3-
"version": "2.8.1",
3+
"version": "2.9.0",
44
"license": "Apache-2.0",
55
"pnpm": {
66
"overrides": {

0 commit comments

Comments
 (0)