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
Copy file name to clipboardExpand all lines: packages/ai/src/changes.md
+17Lines changed: 17 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -622,3 +622,20 @@
622
622
### Expected merge conflict zones
623
623
624
624
- LOW: `src/types.ts``ThinkingContent` interface.
625
+
626
+
## Client abort on Anthropic server-side fallback receipts (2026-07-25)
627
+
628
+
### What changed
629
+
630
+
-`utils/server-fallback-receipt.ts`: new module parsing Anthropic's `fallback` content block and the `fallback_message` entry in `usage.iterations`, plus the refusal-shaped rewrite applied to an aborted turn.
631
+
-`types.ts`: `StreamOptions.abortServerSideFallback` (opt-in), inherited by `SimpleStreamOptions` and `AnthropicOptions`; `api/simple-options.ts` forwards it through `buildBaseOptions`.
632
+
-`api/anthropic-messages.ts`: a provider-local `AbortController`, merged with the caller signal through `combineAbortSignals`, is passed to the request and the SSE iterator. A receipt block or a `fallback_message` usage entry aborts it and finalizes the turn as `{stopReason:"error", stopDetails:{type:"refusal"}}` with empty content plus `server_fallback_aborted` and `billing_incomplete_after_client_abort` diagnostics. A caller abort is checked first and always wins.
633
+
634
+
### Why the extension system couldn't handle this
635
+
636
+
Detection has to happen inside the Anthropic SSE loop while the stream is still open; nothing outside the provider can stop reading a response mid-flight.
637
+
638
+
### Expected merge conflict zones
639
+
640
+
- MEDIUM: `api/anthropic-messages.ts` streaming event loop and request-option construction.
641
+
- LOW: `types.ts``StreamOptions`, `api/simple-options.ts``buildBaseOptions` field list, `index.ts` export list.
0 commit comments