chore(deps): update dependency @openrouter/ai-sdk-provider to v2.2.5#375
Open
renovate[bot] wants to merge 1 commit intomainfrom
Open
chore(deps): update dependency @openrouter/ai-sdk-provider to v2.2.5#375renovate[bot] wants to merge 1 commit intomainfrom
renovate[bot] wants to merge 1 commit intomainfrom
Conversation
f534647 to
a68c331
Compare
a68c331 to
8f2836c
Compare
8f2836c to
8a1aba4
Compare
8a1aba4 to
a8d9561
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 contains the following updates:
2.0.2→2.2.5Release Notes
OpenRouterTeam/ai-sdk-provider (@openrouter/ai-sdk-provider)
v2.2.5Patch Changes
#428
6e2ff61Thanks @robert-j-y! - Surface detailed error information from provider metadata in error messagesWhen OpenRouter returns an error, the top-level
error.messageis often generic (e.g. "Provider returned error"). The actual error details from the upstream provider are inerror.metadata.rawbut were not being surfaced to users.Now
extractErrorMessagerecursively extracts meaningful error messages frommetadata.raw(which can be a string, JSON string, or nested object) and includes the provider name when available. For example, instead of just "Provider returned error", users will now see "[Anthropic] Your credit balance is too low".v2.2.4Compare Source
Patch Changes
#427
34b1c27Thanks @robert-j-y! - fix: preserve thinking block signature in streaming reasoning deltasFixed two bugs causing Anthropic thinking block signatures to be lost during streaming:
Signature-only deltas (containing a signature but no text) were silently dropped by the
if (detail.text)guard in the reasoning delta handler. These deltas are now emitted with an empty string text, ensuring the signature propagates to downstream consumers.Per-delta
providerMetadata.reasoning_detailsonly contained the current chunk's details instead of an accumulated snapshot. This meant the signature (which arrives in a later delta) was never visible in earlier deltas' metadata. Now each reasoning delta carries a snapshot of all accumulated reasoning details.These fixes prevent "Invalid signature in thinking block" errors in multi-turn conversations with Anthropic models.
v2.2.3Compare Source
Patch Changes
#409
7b21d68Thanks @robert-j-y! - Compute missing token usage detail fields from available API dataPreviously,
inputTokens.noCache,outputTokens.text, andinputTokens.cacheWritewere alwaysundefined, even when the data to compute them was available in the API response. This caused downstream dashboards and analytics to receive misleading values.Now the provider computes these fields:
inputTokens.noCache=total - cacheRead(non-cached input tokens)outputTokens.text=total - reasoning(text output tokens)inputTokens.cacheWrite= passthrough fromcache_write_tokenswhen availableThis applies to all code paths: chat
doGenerate, chatdoStream, completiondoGenerate, and completiondoStream.v2.2.2Compare Source
Patch Changes
f7139f1Thanks @robert-j-y! - Supportfilesparameter in image generation for image editing and image-to-image use casesv2.2.1Compare Source
Patch Changes
e3908c6Thanks @robert-j-y! - Add support forauto-routerplugin to configure allowed models when usingopenrouter/autov2.2.0Minor Changes
#399
ad0c2e1Thanks @robert-j-y! - Fix system message cache control to use block-level formatWhen cache control is specified on a system message via
providerOptions, the content is now converted to array format withcache_controlon the text block, matching the existing behavior for user messages. This ensures consistent Anthropic prompt caching behavior across all message types.Before (message-level cache_control):
{ "role": "system", "content": "...", "cache_control": { "type": "ephemeral" } }After (block-level cache_control):
{ "role": "system", "content": [ { "type": "text", "text": "...", "cache_control": { "type": "ephemeral" } } ] }Fixes #389
v2.1.3Patch Changes
50c932cThanks @robert-j-y! - Add support for reasoning effort values 'xhigh', 'minimal', and 'none' in the reasoning configuration type. Previously only 'high', 'medium', and 'low' were accepted.v2.1.2Patch Changes
#395
23f02f1Thanks @robert-j-y! - fix: include accumulated reasoning_details with signature in reasoning-end stream eventWhen streaming a text-only response (no tool calls) with reasoning enabled, the reasoning-end event now includes the accumulated reasoning_details (with signature) in providerMetadata. This fixes multi-turn conversation failures with Anthropic models where the signature was lost, causing "Invalid signature in thinking block" errors on subsequent turns.
v2.1.1Compare Source
Patch Changes
363e232Thanks @robert-j-y! - fix: deduplicate reasoning_details across multi-turn conversations to prevent duplicate ID errorsv2.1.0Compare Source
Minor Changes
#366
f2b78f5Thanks @robert-j-y! - Add imageModel() method to OpenRouter provider for image generation supportThis adds the
imageModel()method to the OpenRouter provider, enabling image generation through the AI SDK'sgenerateImage()function. The implementation uses OpenRouter's chat completions endpoint withmodalities: ['image', 'text']to generate images.Features:
ImageModelV3interface from AI SDKaspectRatioparameter viaimage_configseedparameter for reproducible generationUnsupportedFunctionalityErrorfor image editing (files/mask parameters)Usage:
#361
da10f19Thanks @robert-j-y! - Add support for the Response Healing pluginThe Response Healing plugin automatically validates and repairs malformed JSON responses from AI models. Enable it by adding
{ id: 'response-healing' }to the plugins array when using structured outputs withgenerateObject.Note: Response Healing only works with non-streaming requests.
#360
b129d36Thanks @robert-j-y! - Add includeRawChunks support for streamingWhen
includeRawChunks: trueis passed to streaming calls, the provider now emits{ type: 'raw', rawValue: <parsed chunk> }stream parts for each SSE event, giving consumers access to the raw provider chunks alongside the processed AI SDK stream parts.This feature is available for both chat and completion models.
#357
f24fac7Thanks @robert-j-y! - Remove dependency on @openrouter/sdkThis change removes the external dependency on
@openrouter/sdkby inlining the necessary type definitions locally. The types are now defined insrc/types/openrouter-api-types.ts.This reduces the package's dependency footprint and eliminates potential version conflicts with the SDK.
Patch Changes
#359
85d6633Thanks @robert-j-y! - Fix undefined cost field in providerMetadata causing AI SDK validation failures#362
bd8794aThanks @robert-j-y! - fix: respect user-specified User-Agent headers without modificationPreviously, when users provided a custom
User-Agentheader viacreateOpenRouter({ headers: { 'User-Agent': 'my-app/1.0' } }), the SDK would append its identifier to the header, resulting inmy-app/1.0, ai-sdk/openrouter/x.x.x. This was unexpected behavior.Now, user-specified
User-Agentheaders are used verbatim without modification. The SDK identifier is only added as the default when noUser-Agentheader is provided.This also fixes a case-sensitivity bug where
User-Agent(capitalized) was not recognized as the same header asuser-agent(lowercase), causing duplicate headers to be sent.Fixes #300
#363
f2d5034Thanks @robert-j-y! - Populate usage.raw with OpenRouter raw usage accounting object in finish step#364
c6ae94dThanks @robert-j-y! - Fix missing web search citations by making url_citation schema fields optionalv2.0.4Patch Changes
#352
d76d566Thanks @robert-j-y! - fix: handle tool calls with missing arguments field (#287)Made the arguments field optional in the tool_calls schema and default to '{}' (empty JSON object) when missing. This handles cases where upstream providers may omit the arguments field for tools with no parameters.
Configuration
📅 Schedule: Branch creation - "after 01:00 and before 07:00 every weekday" in timezone Europe/London, Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.