You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 15, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on May 15, 2026. It is now read-only.
OpenRouter proxy: tool calls silently dropped after AI SDK migration (tool-call event ignored) #11419
When using OpenRouter as a proxy, tool calls are silently dropped after the OpenRouter AI SDK migration (PR #10778, Feb 9), producing false "Model Response Incomplete / failed to use any tools" errors. This affects all models routed through OpenRouter and causes retry loops with significant cost inflation.
Root cause
Two interacting issues:
processAiSdkStreamPart() ignores tool-call events (ai-sdk.ts line 491). The handler was designed to rely solely on tool-input-start/delta/end lifecycle events for tool delivery.
@openrouter/ai-sdk-provider v2.1.1 has incomplete lifecycle emission:
Incrementally streamed tool calls: emits tool-input-start + tool-input-delta but never tool-input-end
Flush-path tool calls: emits only tool-call with zero tool-input-* events
The combination means tool calls are silently lost. Prior to the AI SDK migration, OpenRouter used the openai npm package with NativeToolCallParser, which handled tool calls correctly via delta.tool_calls.
Timeline
Date
Version
Event
Jan 15
v3.41.0
OpenRouter uses openai SDK + NativeToolCallParser. Works fine.
After tracing git history, the regression boundary described in this issue is inaccurate. The AI SDK was not present in v3.41.0 or v3.44.0, so neither version could have been affected by the processAiSdkStreamPart() bug fixed in PR #11420.
Actual timeline
Date
Version
Event
Jan 15
v3.41.0
OpenRouter uses openai SDK + NativeToolCallParser. No AI SDK. Works fine.
src/api/transform/ai-sdk.ts was created on Jan 28 — 13 days after v3.41.0 and 1 day after v3.44.0. Neither version used this code path.
OpenRouter used the plain openai npm package at v3.41.0, streaming tool calls via NativeToolCallParser with delta.tool_calls — a completely different code path.
XML removal happened in v3.42.0 (Jan 23), not v3.44.0.
Corrected description
The true regression boundary is not v3.41.0 → v3.44.0. It is pre- vs post-OpenRouter AI SDK migration (PR #10778, Feb 9), which has not shipped in any numbered release. The fix in PR #11420 is correct — the issue description and title should be updated to reflect the actual regression boundary.
changed the title [-]OpenRouter proxy: tool calls silently dropped after v3.41.0 (tool-call event ignored)[/-][+]OpenRouter proxy: tool calls silently dropped after AI SDK migration (tool-call event ignored)[/+]on Feb 12, 2026
Description
When using OpenRouter as a proxy, tool calls are silently dropped after the OpenRouter AI SDK migration (PR #10778, Feb 9), producing false "Model Response Incomplete / failed to use any tools" errors. This affects all models routed through OpenRouter and causes retry loops with significant cost inflation.
Root cause
Two interacting issues:
processAiSdkStreamPart()ignorestool-callevents (ai-sdk.ts line 491). The handler was designed to rely solely ontool-input-start/delta/endlifecycle events for tool delivery.@openrouter/ai-sdk-providerv2.1.1 has incomplete lifecycle emission:tool-input-start+tool-input-deltabut nevertool-input-endtool-callwith zerotool-input-*eventsThe combination means tool calls are silently lost. Prior to the AI SDK migration, OpenRouter used the
openainpm package withNativeToolCallParser, which handled tool calls correctly viadelta.tool_calls.Timeline
openaiSDK +NativeToolCallParser. Works fine.8de9337e6, PR #10841)openaiSDK. Still works.src/api/transform/ai-sdk.tsfirst created (fe722dad2, PR #11047)openaiSDK.The true regression boundary is the OpenRouter AI SDK migration (PR #10778, Feb 9), not v3.41.0 → v3.44.0 as originally stated.
Reproduction
Environment
Expected behavior
Tool calls routed through OpenRouter should be delivered and executed identically to direct provider connections.