Skip to content
Source
Sign inSign up
TanStack/ai

fix(ai-openrouter): set errorType from error_type on response.failed #2268

Mergedpcbeingused33(GitHub profile, opens in a new tab)merged 2 commits intomain fromrefs/pull/2268/headmerged by AlemTuzlak View on GitHub

Showing 8 changed files with 7 additions and 2 deletions (loading 4).

x
0 of 8 viewed, 8 left
5 additions and 0 deletions.changeset/openrouter-responses-error-type.mdAdded
View file
@@ -0,0 +1,5 @@
+---
+'@tanstack/ai-openrouter': patch
+---
+​
+fix(ai-openrouter): set `errorType` on the Responses adapter's `RUN_ERROR` from the `error_type` of a `response.failed` event
1 addition and 1 deletiondocs/chat/stream-events.mdModified
View file
@@ -348,7 +348,7 @@
- `errorType`: the error type from the provider, for example `overloaded_error` or `rate_limit_exceeded`. A string of at most 128 characters.
- `requestId`: the id of the failed request, from the SDK error or the `request-id` / `x-request-id` header.
​
-`code` stays the HTTP status, for example `"529"`. The Anthropic adapter and the adapters built on `@tanstack/openai-base` set both fields when the provider sends them.
+`code` stays the HTTP status, for example `"529"`. The Anthropic adapter and the adapters built on `@tanstack/openai-base` set both fields when the provider sends them. The OpenRouter Responses adapter sets `errorType` from the `error_type` of a `response.failed` event.
​
On the server:
​
1 addition and 1 deletiondocs/config.jsonModified
View file
@@ -249,7 +249,7 @@
"label": "Stream Events",
"to": "chat/stream-events",
"addedAt": "2026-08-26",
- "updatedAt": "2026-10-22"
+ "updatedAt": "2026-11-26"
"label": "Subagents",