Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: vercel/ai
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: @ai-sdk/mcp@1.0.88
Choose a base ref
...
head repository: vercel/ai
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: @ai-sdk/mcp@1.0.89
Choose a head ref
  • 19 commits
  • 144 files changed
  • 12 contributors

Commits on Sep 28, 2026

  1. fix(anthropic): normalize orphaned callers in pruned history (v6) (#2…

    …1628)
    
    ## Background
    
    Pruning a converted multi-step Anthropic conversation can remove a code
    execution source while retaining a dependent tool call with
    `caller.toolId`. Anthropic rejects the next user turn with `source tool
    ... not found for tool use block ...`.
    
    Backports #21623 to `release-v6.0` (`@ai-sdk/anthropic` 3.x). The v6
    provider has the same affected caller serialization. The v5 provider
    does not serialize this metadata, so this fix does not apply to v5.
    
    ## Summary
    
    - Normalize dangling programmatic caller references entirely inside the
    Anthropic converter. Keep retained calls, results, ordering, and cache
    controls, and emit one warning per affected call.
    - Only normalize history before a subsequent user message. Preserve
    direct callers, valid references, and active tool continuations; pruned
    source history is not reconstructed.
    - Adapt the source PR to `convertToAnthropicMessagesPrompt` and V3
    provider types. Include the same regressions, runnable reproduction,
    provider documentation, and patch changeset.
    - Preserve Daniel Lantz (@dflantz) as a commit co-author.
    
    ## Manual Verification
    
    Ran `convertToModelMessages` → `pruneMessages` → `generateText` against
    the live Anthropic API with `claude-opus-4-5`. Both
    `code_execution_20250825` and `code_execution_20260120` succeeded,
    returned the retained AAPL price ($185.42), and emitted the expected
    omission warning. The reproduction asserts that pruning still removes
    the source and retains the dependent tool call.
    
    ```sh
    pnpm -C examples/ai-functions exec tsx src/generate-text/anthropic/pruned-programmatic-tool-calling.ts
    pnpm -C examples/ai-functions exec tsx src/generate-text/anthropic/pruned-programmatic-tool-calling.ts code_execution_20260120
    ```
    
    ## Validation
    
    - Confirmed the new normalization regressions fail on the unmodified v6
    converter.
    - Anthropic Node and Edge suites: 479 tests passed in each environment,
    including generation and streaming request/warning checks.
    - `pnpm type-check:full`
    - `pnpm check`
    - `git diff --check`
    
    ## Checklist
    
    - [x] Tests have been added / updated (for bug fixes / features)
    - [x] Documentation has been added / updated (for bug fixes / features)
    - [x] A _patch_ changeset for relevant packages has been added (for bug
    fixes / features - run `pnpm changeset` in the project root)
    - [x] I have reviewed this pull request (self-review)
    
    ## Related Issues
    
    Backport of #21623 (source commit
    f8f6985).
    Addresses #12504 on AI SDK 6.
    
    Co-authored-by: Daniel Lantz <6571678+dflantz@users.noreply.github.com>
    gr2m and dflantz authored Sep 28, 2026
    Configuration menu
    Copy the full SHA
    eeabdce View commit details
    Browse the repository at this point in the history
  2. [v6.0] fix: resumeStream fails to continue active UI message parts af…

    …ter a disconnect (#21634)
    
    ## Background
    
    The published ai package failed to resume an interrupted UI message
    stream when reconnection began with a text-delta for a text part opened
    before the disconnect.
    
    ## Root Cause
    
    After a network disconnect, AbstractChat discarded the streaming state
    containing active part ID mappings and created fresh state for
    resumeStream. The reproduction confirmed that the resumed text-delta
    could not find text-1 despite its existing partial message.
    
    ## Summary
    
    AbstractChat now retains streaming state across network disconnects and
    reuses it for reconnection, while clearing it after completion,
    cancellation, non-network errors, or new requests. Added a patch
    changeset.
    
    ## Testing
    
    Added a regression test covering disconnection after text-start and
    successful resumption beginning with a same-ID text-delta.
    
    ## End-to-end Validation
    
    - `pnpm -C packages/ai build` followed by immutable replay `pnpm -C
    examples/ai-functions exec tsx
    src/reproduction/issue-13160-resume-text-delta.ts`: build succeeded and
    the reproduction exited successfully without the original failure
    signal.
    
    ## Related Issues
    
    Fixes #13160
    
    Closes #21503
    
    Backport of #21509
    
    Co-authored-by: ai-sdk-factory[bot] <305873210+ai-sdk-factory[bot]@users.noreply.github.com>
    Co-authored-by: ai-sdk-factory <308175966+ai-sdk-factory@users.noreply.github.com>
    Co-authored-by: KaranJayakumar <117019183+KaranJayakumar@users.noreply.github.com>
    Co-authored-by: Gregor Martynus <39992+gr2m@users.noreply.github.com>
    4 people authored Sep 28, 2026
    Configuration menu
    Copy the full SHA
    0b38b6b View commit details
    Browse the repository at this point in the history
  3. Backport: feat(provider/anthropic): add Claude Sonnet 5.5 support v6 (#…

    …21632)
    
    ## Background
    
    Backport of #21631 to `release-v6.0`.
    
    Claude Sonnet 5.5 (`claude-sonnet-5-5`) rejects `thinking: { type:
    'disabled' }`, budget-based thinking, forced `tool_choice` (`required`
    or a named tool, including the `jsonTool` structured output mode), and
    the older `computer_*` tool types. It adds a new lowest thinking
    setting, `thinking: { type: 'between_tools' }`, which is only accepted
    at `low`, `medium`, and `high` effort.
    
    ## Summary
    
    - Add the `claude-sonnet-5-5` model ID to `@ai-sdk/anthropic` and
    `@ai-sdk/google-vertex`, `anthropic.claude-sonnet-5-5` /
    `us.anthropic.claude-sonnet-5-5` to `@ai-sdk/amazon-bedrock`, and
    `anthropic/claude-sonnet-5.5` to `@ai-sdk/gateway`.
    - Add a `supportsBetweenToolsThinking` model capability and the
    `thinking: { type: 'between_tools' }` provider option. Combining it with
    `xhigh` or `max` effort lowers the effort to `high` with a warning.
    - For `claude-sonnet-5-5`: `thinking: { type: 'disabled' }` is replaced
    with `between_tools` (with a warning) and budget-based thinking becomes
    adaptive. The existing `rejectsForcedToolUse` handling downgrades
    `required` / named tool choices to `auto` and `jsonTool` to
    `outputFormat`, each with a warning.
    - Docs: model tables, effort guidance, a "Between-Tools Thinking"
    section, and Sonnet 5.5 notes for thinking updates, block binding, and
    the computer toolset.
    - New examples:
    `examples/ai-functions/src/generate-text/anthropic/claude-sonnet-5-5.ts`,
    `generate-text/anthropic/claude-sonnet-5-5-between-tools.ts`,
    `stream-text/anthropic/claude-sonnet-5-5-between-tools.ts`,
    `stream-text/anthropic/claude-sonnet-5-5-thinking-updates.ts`.
    
    Unlike `main`, this branch has no top-level `reasoning` option, so there
    is no `reasoning: 'none'` mapping. Docs and examples that use
    `claude-sonnet-5` generically are not bulk-updated, matching the Opus
    5.5 backports.
    
    ## End-to-End Verification
    
    The same changes were verified on `main` (#21631) against the Anthropic
    API with `claude-sonnet-5-5`. On this branch, the Anthropic, Amazon
    Bedrock, Gateway, and Google Vertex unit tests, `pnpm type-check:full`,
    and `pnpm check` pass.
    
    Co-authored-by: Claude <noreply@anthropic.com>
    gr2m and claude authored Sep 28, 2026
    Configuration menu
    Copy the full SHA
    358683e View commit details
    Browse the repository at this point in the history
  4. Version Packages (#21630)

    This PR was opened by the [Changesets
    release](https://github.com/changesets/action) GitHub action. When
    you're ready to do a release, you can merge this and the packages will
    be published to npm automatically. If you're not ready to do a release
    yet, that's fine, whenever you add more changesets to release-v6.0, this
    PR will be updated.
    
    
    # Releases
    ## ai@6.0.295
    
    ### Patch Changes
    
    - 0b38b6b: fix(ai): continue active UI message parts when resuming after
    a disconnect
    - Updated dependencies [358683e]
      - @ai-sdk/gateway@3.0.205
    ## @ai-sdk/amazon-bedrock@4.0.186
    
    ### Patch Changes
    
    - 358683e: feat(anthropic): add Claude Sonnet 5.5 support
    
    - add the `claude-sonnet-5-5` model ID to `@ai-sdk/anthropic` and
    `@ai-sdk/google-vertex`, `anthropic.claude-sonnet-5-5` and
    `us.anthropic.claude-sonnet-5-5` to `@ai-sdk/amazon-bedrock`, and
    `anthropic/claude-sonnet-5.5` to `@ai-sdk/gateway`
    - add the `between_tools` thinking type (`thinking: { type:
    'between_tools' }`), the lowest thinking setting on `claude-sonnet-5-5`;
    `xhigh` and `max` effort are lowered to `high` with a warning because
    the API rejects them with `between_tools`
    - `claude-sonnet-5-5` rejects disabled thinking: `thinking: { type:
    'disabled' }` is replaced with `between_tools` thinking (with a
    warning), and budget-based thinking is converted to adaptive thinking
    - `claude-sonnet-5-5` rejects forced tool use: `required` and named tool
    choices fall back to `auto`, and `structuredOutputMode: 'jsonTool'`
    falls back to native structured outputs, each with a warning
    
    - Updated dependencies [358683e]
    - Updated dependencies [eeabdce]
      - @ai-sdk/anthropic@3.0.125
    ## @ai-sdk/angular@2.0.296
    
    ### Patch Changes
    
    - Updated dependencies [0b38b6b]
      - ai@6.0.295
    ## @ai-sdk/anthropic@3.0.125
    
    ### Patch Changes
    
    - 358683e: feat(anthropic): add Claude Sonnet 5.5 support
    
    - add the `claude-sonnet-5-5` model ID to `@ai-sdk/anthropic` and
    `@ai-sdk/google-vertex`, `anthropic.claude-sonnet-5-5` and
    `us.anthropic.claude-sonnet-5-5` to `@ai-sdk/amazon-bedrock`, and
    `anthropic/claude-sonnet-5.5` to `@ai-sdk/gateway`
    - add the `between_tools` thinking type (`thinking: { type:
    'between_tools' }`), the lowest thinking setting on `claude-sonnet-5-5`;
    `xhigh` and `max` effort are lowered to `high` with a warning because
    the API rejects them with `between_tools`
    - `claude-sonnet-5-5` rejects disabled thinking: `thinking: { type:
    'disabled' }` is replaced with `between_tools` thinking (with a
    warning), and budget-based thinking is converted to adaptive thinking
    - `claude-sonnet-5-5` rejects forced tool use: `required` and named tool
    choices fall back to `auto`, and `structuredOutputMode: 'jsonTool'`
    falls back to native structured outputs, each with a warning
    
    - eeabdce: Normalize dangling programmatic tool caller references in
    conversation history after pruning. Before a subsequent user message,
    omit caller metadata whose source code execution call is missing and
    emit a warning, preserving the retained tool calls and results. Keep
    caller metadata unchanged for active tool continuations.
    ## @ai-sdk/anthropic-aws@1.0.47
    
    ### Patch Changes
    
    - Updated dependencies [358683e]
    - Updated dependencies [eeabdce]
      - @ai-sdk/anthropic@3.0.125
    ## @ai-sdk/gateway@3.0.205
    
    ### Patch Changes
    
    - 358683e: feat(anthropic): add Claude Sonnet 5.5 support
    
    - add the `claude-sonnet-5-5` model ID to `@ai-sdk/anthropic` and
    `@ai-sdk/google-vertex`, `anthropic.claude-sonnet-5-5` and
    `us.anthropic.claude-sonnet-5-5` to `@ai-sdk/amazon-bedrock`, and
    `anthropic/claude-sonnet-5.5` to `@ai-sdk/gateway`
    - add the `between_tools` thinking type (`thinking: { type:
    'between_tools' }`), the lowest thinking setting on `claude-sonnet-5-5`;
    `xhigh` and `max` effort are lowered to `high` with a warning because
    the API rejects them with `between_tools`
    - `claude-sonnet-5-5` rejects disabled thinking: `thinking: { type:
    'disabled' }` is replaced with `between_tools` thinking (with a
    warning), and budget-based thinking is converted to adaptive thinking
    - `claude-sonnet-5-5` rejects forced tool use: `required` and named tool
    choices fall back to `auto`, and `structuredOutputMode: 'jsonTool'`
    falls back to native structured outputs, each with a warning
    ## @ai-sdk/google-vertex@4.0.208
    
    ### Patch Changes
    
    - 358683e: feat(anthropic): add Claude Sonnet 5.5 support
    
    - add the `claude-sonnet-5-5` model ID to `@ai-sdk/anthropic` and
    `@ai-sdk/google-vertex`, `anthropic.claude-sonnet-5-5` and
    `us.anthropic.claude-sonnet-5-5` to `@ai-sdk/amazon-bedrock`, and
    `anthropic/claude-sonnet-5.5` to `@ai-sdk/gateway`
    - add the `between_tools` thinking type (`thinking: { type:
    'between_tools' }`), the lowest thinking setting on `claude-sonnet-5-5`;
    `xhigh` and `max` effort are lowered to `high` with a warning because
    the API rejects them with `between_tools`
    - `claude-sonnet-5-5` rejects disabled thinking: `thinking: { type:
    'disabled' }` is replaced with `between_tools` thinking (with a
    warning), and budget-based thinking is converted to adaptive thinking
    - `claude-sonnet-5-5` rejects forced tool use: `required` and named tool
    choices fall back to `auto`, and `structuredOutputMode: 'jsonTool'`
    falls back to native structured outputs, each with a warning
    
    - Updated dependencies [358683e]
    - Updated dependencies [eeabdce]
      - @ai-sdk/anthropic@3.0.125
    ## @ai-sdk/langchain@2.0.303
    
    ### Patch Changes
    
    - Updated dependencies [0b38b6b]
      - ai@6.0.295
    ## @ai-sdk/llamaindex@2.0.295
    
    ### Patch Changes
    
    - Updated dependencies [0b38b6b]
      - ai@6.0.295
    ## @ai-sdk/minimax@2.0.23
    
    ### Patch Changes
    
    - Updated dependencies [358683e]
    - Updated dependencies [eeabdce]
      - @ai-sdk/anthropic@3.0.125
    ## @ai-sdk/react@3.0.298
    
    ### Patch Changes
    
    - Updated dependencies [0b38b6b]
      - ai@6.0.295
    ## @ai-sdk/rsc@2.0.295
    
    ### Patch Changes
    
    - Updated dependencies [0b38b6b]
      - ai@6.0.295
    ## @ai-sdk/svelte@4.0.295
    
    ### Patch Changes
    
    - Updated dependencies [0b38b6b]
      - ai@6.0.295
    ## @ai-sdk/vue@3.0.295
    
    ### Patch Changes
    
    - Updated dependencies [0b38b6b]
      - ai@6.0.295
    
    Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
    github-actions[bot] authored Sep 28, 2026
    Configuration menu
    Copy the full SHA
    e1b3faa View commit details
    Browse the repository at this point in the history
  5. [v6.0] fix: allow agent UI streams to run persistence flows with only…

    … originalMessages (#21636)
    
    ## Background
    
    createAgentUIStream rejected persistence flows that supplied
    originalMessages without uiMessages, preventing agent execution despite
    supporting originalMessages for stream persistence.
    
    ## Root Cause
    
    createAgentUIStream always validated and converted uiMessages, whose
    type was required, while originalMessages was only forwarded to the
    output stream. The reproduction confirmed undefined uiMessages reached
    validation and caused the missing-messages error.
    
    ## Summary
    
    Made uiMessages optional across the agent UI stream helpers, use
    originalMessages as the agent input fallback, updated documentation, and
    added an ai package patch changeset.
    
    ## Testing
    
    Added regression coverage confirming originalMessages supplies the model
    prompt, generates the assistant message ID, and produces the complete
    persisted history.
    
    ## End-to-end Validation
    
    - `pnpm -C examples/ai-functions exec tsx
    src/reproduction/issue-10367-create-agent-ui-stream-original-messages.ts`
    via immutable replay completed successfully with exit code 0 and no
    original bug signal.
    
    ## Related Issues
    
    Fixes #10367
    
    Closes #21629
    
    ---------
    
    Co-authored-by: ai-sdk-factory <308175966+ai-sdk-factory@users.noreply.github.com>
    Co-authored-by: Gregor Martynus <39992+gr2m@users.noreply.github.com>
    Co-authored-by: christ12938 <25758598+christ12938@users.noreply.github.com>
    4 people authored Sep 28, 2026
    Configuration menu
    Copy the full SHA
    0741da8 View commit details
    Browse the repository at this point in the history
  6. [v6.0] fix: preserve tool metadata from tool output chunks in UI mess…

    …age streams (#21637)
    
    ## Background
    
    Tool metadata produced after a tool completed was discarded, preventing
    final status, cache, timing, or download metadata from reaching UI
    message parts.
    
    ## Root Cause
    
    The output-available and output-error handlers copied toolMetadata only
    from the existing tool invocation instead of the output chunk. The
    reproduction confirmed this across static and dynamic tool paths.
    
    ## Summary
    
    Updated all static and dynamic tool output handlers to prefer
    output-chunk metadata while retaining existing metadata when the output
    chunk omits it. Added a patch changeset.
    
    ## Testing
    
    Added regression coverage for available and error outputs on both static
    and dynamic tools, including replacement of stale input metadata.
    
    ## End-to-end Validation
    
    - `replay_original_reproduction`: the immutable reproduction exited
    successfully and reported that all output chunks propagated tool
    metadata.
    
    ## Related Issues
    
    Fixes #16930
    
    Closes #21627
    
    Backport of #21615
    
    ---------
    
    Co-authored-by: ai-sdk-factory[bot] <305873210+ai-sdk-factory[bot]@users.noreply.github.com>
    Co-authored-by: ai-sdk-factory <308175966+ai-sdk-factory@users.noreply.github.com>
    Co-authored-by: Gregor Martynus <39992+gr2m@users.noreply.github.com>
    Co-authored-by: matanper <9868530+matanper@users.noreply.github.com>
    4 people authored Sep 28, 2026
    Configuration menu
    Copy the full SHA
    a63fa9b View commit details
    Browse the repository at this point in the history
  7. [v6.0] fix: preserve smoothStream provider metadata without loss or c…

    …ross-delta leakage (#21646)
    
    ## Background
    
    smoothStream dropped provider metadata from loop-emitted text and
    reasoning chunks, while incomplete metadata state handling could lose
    signature-only deltas or associate metadata with unrelated later
    content.
    
    ## Root Cause
    
    The chunk-detection loop omitted buffered provider metadata, and the
    buffer state was not bounded by metadata ownership. Immutable replay
    confirmed the original metadata loss, while exact-boundary and
    multi-delta probes confirmed signature loss, stale inheritance, and
    overwrite paths.
    
    ## Summary
    
    Propagated provider metadata to loop-emitted smoothStream deltas,
    preserved empty metadata-bearing deltas, flushed buffers at metadata
    boundaries, cleared consumed metadata, added a patch changeset, and
    added regression coverage for preservation and isolation.
    
    ## Testing
    
    Regression coverage now includes word-chunked reasoning, line-chunked
    text, empty metadata after exact boundaries, metadata-bearing to
    metadata-free same-ID transitions, distinct consecutive metadata, and
    type/ID transitions. Node, Edge, full workspace tests, formatting, lint,
    type checking, and immutable reproduction replay pass.
    
    ## End-to-end Validation
    
    - Immutable replay of `pnpm -C examples/ai-functions exec tsx
    src/reproduction/smooth-stream-provider-metadata.ts` exited 0 and showed
    metadata on every corresponding word- and line-chunked delta.
    
    ## Related Issues
    
    Fixes #14373
    
    Closes #19528
    
    Backport of #19561
    
    Co-authored-by: ai-sdk-factory[bot] <305873210+ai-sdk-factory[bot]@users.noreply.github.com>
    Co-authored-by: ai-sdk-factory <308175966+ai-sdk-factory@users.noreply.github.com>
    Co-authored-by: kuishou68 <54054995+kuishou68@users.noreply.github.com>
    Co-authored-by: Gregor Martynus <39992+gr2m@users.noreply.github.com>
    4 people authored Sep 28, 2026
    Configuration menu
    Copy the full SHA
    a61bea9 View commit details
    Browse the repository at this point in the history
  8. Version Packages (#21641)

    This PR was opened by the [Changesets
    release](https://github.com/changesets/action) GitHub action. When
    you're ready to do a release, you can merge this and the packages will
    be published to npm automatically. If you're not ready to do a release
    yet, that's fine, whenever you add more changesets to release-v6.0, this
    PR will be updated.
    
    
    # Releases
    ## ai@6.0.296
    
    ### Patch Changes
    
    - 0741da8: fix(ai): allow agent UI streams to use original messages as
    input
    - a63fa9b: fix(ai): preserve tool metadata from tool output chunks
    - a61bea9: Preserve provider metadata on corresponding `smoothStream`
    chunks without carrying it into subsequent metadata-free deltas.
    ## @ai-sdk/angular@2.0.297
    
    ### Patch Changes
    
    - Updated dependencies [0741da8]
    - Updated dependencies [a63fa9b]
    - Updated dependencies [a61bea9]
      - ai@6.0.296
    ## @ai-sdk/langchain@2.0.304
    
    ### Patch Changes
    
    - Updated dependencies [0741da8]
    - Updated dependencies [a63fa9b]
    - Updated dependencies [a61bea9]
      - ai@6.0.296
    ## @ai-sdk/llamaindex@2.0.296
    
    ### Patch Changes
    
    - Updated dependencies [0741da8]
    - Updated dependencies [a63fa9b]
    - Updated dependencies [a61bea9]
      - ai@6.0.296
    ## @ai-sdk/react@3.0.299
    
    ### Patch Changes
    
    - Updated dependencies [0741da8]
    - Updated dependencies [a63fa9b]
    - Updated dependencies [a61bea9]
      - ai@6.0.296
    ## @ai-sdk/rsc@2.0.296
    
    ### Patch Changes
    
    - Updated dependencies [0741da8]
    - Updated dependencies [a63fa9b]
    - Updated dependencies [a61bea9]
      - ai@6.0.296
    ## @ai-sdk/svelte@4.0.296
    
    ### Patch Changes
    
    - Updated dependencies [0741da8]
    - Updated dependencies [a63fa9b]
    - Updated dependencies [a61bea9]
      - ai@6.0.296
    ## @ai-sdk/vue@3.0.296
    
    ### Patch Changes
    
    - Updated dependencies [0741da8]
    - Updated dependencies [a63fa9b]
    - Updated dependencies [a61bea9]
      - ai@6.0.296
    
    Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
    github-actions[bot] authored Sep 28, 2026
    Configuration menu
    Copy the full SHA
    d4f6c23 View commit details
    Browse the repository at this point in the history
  9. [v6.0] fix: prevent unexpected chat resumption after terminal text fo…

    …llows a completed tool call (#21656)
    
    ## Background
    
    A completed backend tool output followed by terminal error text caused
    the UI chat helper to report completion and automatically submit another
    request.
    
    ## Root Cause
    
    The helper evaluated completed tool parts in the final step without
    accounting for later text lacking a completed stream state, so the
    completed tool produced a false-positive resumption signal. The
    immutable reproduction and regression tests confirmed this behavior.
    
    ## Summary
    
    Updated the completion helper to reject completed tools followed by
    uncompleted terminal text while retaining resumption for text marked
    `done`, added helper and chat integration regressions, and included an
    `ai` patch changeset. No dependencies or configuration were changed.
    
    ## Testing
    
    Helper and chat integration tests cover terminal error text stopping
    automatic submission and completed model text preserving client
    tool-result submission. Focused Node and Edge tests, the complete
    repository test suite, linting, formatting, and full type checking pass.
    
    ## End-to-end Validation
    
    - `replay_original_reproduction`: returned `false`, exited successfully,
    and classified the issue as `no-longer-reproduces`.
    
    ## Related Issues
    
    Fixes #12099
    
    Closes #21644
    
    Backport of #21622
    
    ---------
    
    Co-authored-by: ai-sdk-factory[bot] <305873210+ai-sdk-factory[bot]@users.noreply.github.com>
    Co-authored-by: ai-sdk-factory <308175966+ai-sdk-factory@users.noreply.github.com>
    Co-authored-by: Gregor Martynus <39992+gr2m@users.noreply.github.com>
    Co-authored-by: alexandrudanpop <15979292+alexandrudanpop@users.noreply.github.com>
    4 people authored Sep 28, 2026
    Configuration menu
    Copy the full SHA
    d4203d2 View commit details
    Browse the repository at this point in the history
  10. fix(ai): backport reconnect chat ID encoding to v6 (#21661)

    ## Background
    
    Backport of #21649 to `release-v6.0`.
    
    Reconnect URLs interpolate chat IDs into a path, so an ID such as
    `../other-route` changes the route and `?` or `#` changes URL
    interpretation. An empty API base can also turn a leading slash in the
    ID into a different host.
    
    ## Summary
    
    This release did not yet have the query-aware path helper, so include it
    and its regression coverage from main.
    
    Encode the ID as a single segment and append the reconnect path before
    any base query or fragment. Reject standalone `.` and `..` before
    fetching, since percent-encoding does not prevent URL dot-segment
    normalization. Preserve the original ID passed to
    `prepareReconnectToStreamRequest` and use its custom URL verbatim.
    Document the behavior and update the custom endpoint examples.
    
    Validation: 14 regression cases fail before the fix; all 24 transport
    tests pass in Node and Edge after it. Full workspace type checking,
    targeted lint/format checks, and MDX parsing pass. Includes an `ai`
    patch changeset.
    
    ## Contributor Credit
    
    Reported by @trmxvibs in #18187. Related proposed fixes: #18395 and
    #20001.
    
    ## Manual Verification
    
    Ran `DefaultChatTransport` against a local HTTP server. The server
    received encoded IDs for traversal-like, query/fragment, and
    percent-containing values, with the original API query intact.
    Standalone `..` was rejected without a request; a custom prepared URL
    was requested unchanged.
    
    ## Checklist
    
    - [x] Tests have been added / updated (for bug fixes / features)
    - [x] Documentation has been added / updated (for bug fixes / features)
    - [x] A _patch_ changeset for relevant packages has been added (for bug
    fixes / features - run `pnpm changeset` in the project root)
    - [x] I have reviewed this pull request (self-review)
    
    ## Related Issues
    
    Addresses finding 3 of #18187. The other findings are tracked
    separately.
    gr2m authored Sep 28, 2026
    Configuration menu
    Copy the full SHA
    850d4d5 View commit details
    Browse the repository at this point in the history
  11. fix(ai,mcp): backport prototype-safe maps to v6 (#21658)

    ## Background
    
    Backport of #21648 to `release-v6.0`, adapted to the release’s provider
    interfaces.
    
    Tools, provider IDs, and provider metadata named `__proto__` can change
    lookup object prototypes instead of becoming own properties. Inherited
    names such as `constructor` can also resolve as unregistered providers
    or crash image metadata aggregation.
    
    ## Summary
    
    V6 uses an inline video metadata merge and has no per-image metadata
    getter.
    
    Use null-prototype maps for MCP tools and the provider registry. Merge
    embedding, image, and video metadata with own-property reads and writes,
    while retaining plain objects in returned metadata. Add regressions for
    prototype-named keys and patch changesets for `ai` and `@ai-sdk/mcp`.
    
    Validation: the added regressions exposed failures in all five
    applicable areas before the fix. The affected AI SDK suites pass 166
    tests in each of Node and Edge; the MCP client suite passes 82 in each.
    Changed-file lint and formatting checks and `pnpm type-check:full` pass.
    
    ## Contributor Credit
    
    Reported by @trmxvibs in #18187. Related proposed fix: #20005.
    
    ## Manual Verification
    
    Ran a standalone local reproduction through embedding, image, and video
    generation, provider lookup, and MCP tool discovery/execution using
    synthetic models and an in-memory MCP transport. `__proto__` survives
    enumeration and execution, returned metadata retains its ordinary
    prototype, and provider members do not become registered providers. No
    live provider credentials are required.
    
    ## Checklist
    
    - [x] Tests have been added / updated (for bug fixes / features)
    - [ ] Documentation has been added / updated (for bug fixes / features)
    - [x] A _patch_ changeset for relevant packages has been added (for bug
    fixes / features - run `pnpm changeset` in the project root)
    - [x] I have reviewed this pull request (self-review)
    
    ## Related Issues
    
    Addresses finding 1 of #18187. The other findings are tracked
    separately.
    gr2m authored Sep 28, 2026
    Configuration menu
    Copy the full SHA
    cdc5b56 View commit details
    Browse the repository at this point in the history
  12. Backport: chore(provider/gateway): update gateway model settings file…

    …s v6 (#21609)
    
    Automated update of the gateway model settings files.
    
    Regenerated from the upstream gateway model list by
    [`update-model-settings.yml`](https://github.com/vercel/ai/blob/main/.github/workflows/update-model-settings.yml)
    ([this run](https://github.com/vercel/ai/actions/runs/36450474963)).
    Merging this PR is what surfaces newly-released gateway models as IDE
    autocomplete suggestions when users type a model string with
    `@ai-sdk/gateway`.
    
    See the workflow file for details on cadence and scope.
    
    Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
    github-actions[bot] authored Sep 28, 2026
    Configuration menu
    Copy the full SHA
    03e5a25 View commit details
    Browse the repository at this point in the history
  13. docs(ai): document provider tool error exception in v6 (#21663)

    ## Background
    
    Backport of #21650 to `release-v6.0`. The exception exists in v6; v5
    still masks these errors through `onError`, so this documentation does
    not apply there.
    
    The UI stream documentation describes default error masking without
    explaining the intentional exception for provider-executed tool
    execution errors. Applying `onError` to these errors would discard
    provider error codes needed for subsequent model requests.
    
    ## Summary
    
    Use v6’s `result.toUIMessageStream()` and
    `result.toUIMessageStreamResponse()` APIs and document the inline
    converter in `stream-text.ts`. Omit main-only harness references.
    
    Document the exception in the chatbot and tool guides, API reference,
    shipped type comments, and conversion code. Explain that strings pass
    through unchanged, other values are JSON-stringified, and invalid tool
    calls and stream errors still use `onError`. Explicitly state that the
    callback cannot redact provider-executed tool execution errors before
    they reach the client.
    
    Runtime behavior is unchanged: both edited TypeScript files emit
    identical JavaScript with comments removed. Existing streamText and
    model-message conversion tests pass (437 in each of Node and Edge), as
    do MDX parsing, targeted lint/format checks, and the full workspace type
    check. The patch changeset covers the shipped API documentation.
    
    ## Contributor Credit
    
    Reported by @trmxvibs in #18187. The behavior was introduced by #13256
    to preserve Anthropic tool error codes.
    
    ## Checklist
    
    - [ ] Tests have been added / updated (for bug fixes / features)
    - [x] Documentation has been added / updated (for bug fixes / features)
    - [x] A _patch_ changeset for relevant packages has been added (for bug
    fixes / features - run `pnpm changeset` in the project root)
    - [x] I have reviewed this pull request (self-review)
    
    ## Related Issues
    
    Addresses finding 4 of #18187 by documenting the intentional exception.
    The other findings are tracked separately.
    gr2m authored Sep 28, 2026
    Configuration menu
    Copy the full SHA
    ce660b0 View commit details
    Browse the repository at this point in the history

Commits on Sep 29, 2026

  1. [v6.0] fix: resume hydrated partial static tool calls without losing …

    …streaming state (#21665)
    
    ## Background
    
    Hydrated assistant messages containing unfinished static tool input
    could not accept resumed deltas, and successfully resumed calls could
    lose their state after another interruption.
    
    ## Root Cause
    
    The stream state builder did not reconstruct unfinished hydrated tool
    calls, Chat resume discarded the relevant assistant message or resumable
    state, and streaming updates did not consistently retain accumulated raw
    input. The immutable reproduction confirmed both original resume paths,
    while repeated-interruption and dynamic-error tests confirmed the
    broader state transitions.
    
    ## Summary
    
    Reconstructs unfinished static and dynamic tool-call state, preserves
    hydrated and in-memory resumable assistant state across interruptions,
    retains rawInput only while input is streaming, updates public typing
    and validation, documents persistence requirements, updates framework
    expectations, and includes a patch changeset.
    
    ## Testing
    
    Regression coverage includes readUIMessageStream, repeated
    Chat.resumeStream interruptions, legacy messages without raw input,
    stream processing, public types, validation, framework rendering, and
    dynamic terminal errors. Focused Node and Edge suites each passed 161
    tests; package and full-workspace type checks, formatting, and linting
    passed.
    
    ## End-to-end Validation
    
    - `replay_original_reproduction` ran `pnpm -C examples/ai-functions exec
    tsx src/reproduction/issue-14027-partial-static-tool-resume.ts` and
    reported `no-longer-reproduces`.
    
    ## Related Issues
    
    Fixes #14027
    
    Closes #21474
    
    Backport of #21480
    
    ---------
    
    Co-authored-by: ai-sdk-factory[bot] <305873210+ai-sdk-factory[bot]@users.noreply.github.com>
    Co-authored-by: ai-sdk-factory <308175966+ai-sdk-factory@users.noreply.github.com>
    ai-sdk-factory[bot] and ai-sdk-factory authored Sep 29, 2026
    Configuration menu
    Copy the full SHA
    8349396 View commit details
    Browse the repository at this point in the history
  2. [v6] feat(openai): add GPT-6.1 Sol model support (#21749)

    Backport of #21747.
    
    Original PR: #21747
    n1ckoates authored Sep 29, 2026
    Configuration menu
    Copy the full SHA
    4972874 View commit details
    Browse the repository at this point in the history
  3. [v6.0] fix: idle UI message streams failing to flush promptly or rema…

    …in open behind reverse proxies (#21791)
    
    ## Background
    
    Idle UI message streams emitted no initial response byte or inactivity
    traffic, allowing reverse proxies to time out healthy streams and
    eventually exhaust transport reconnect attempts.
    
    ## Root Cause
    
    The SSE pipeline emitted only when its source produced or completed, so
    idle sources could not flush headers or generate heartbeat traffic. The
    initial fix's repeated Promise.race calls also accumulated reactions on
    the unresolved source read; the immutable replay and sustained-idle
    regression confirm both defects are resolved.
    
    ## Summary
    
    Added opt-in keepAliveMs support that emits an immediate SSE opening
    comment and periodic inactivity comments across Response,
    ServerResponse, and agent helpers. The scheduler now retains one
    source-read reaction and one timer, propagates cancellation, respects
    backpressure, and is documented with a patch changeset.
    
    ## Testing
    
    Coverage includes opening comments, idle heartbeats, activity-based
    timer resets, 2,500 consecutive heartbeats with one retained read
    reaction, source completion and cancellation, and Response and
    ServerResponse integrations. The complete ai package tests, full
    workspace type checking, checks, and documentation validation pass.
    
    ## End-to-end Validation
    
    - `pnpm -C examples/ai-functions exec tsx
    src/reproduction/issue-17805.ts` — exited 0 without the immutable
    reproduction signal; first-byte flushing and idle keep-alive behavior
    prevented reconnect exhaustion.
    
    ## Related Issues
    
    Fixes #17805
    
    Closes #21654
    
    Backport of #21672
    
    ---------
    
    Co-authored-by: ai-sdk-factory[bot] <305873210+ai-sdk-factory[bot]@users.noreply.github.com>
    Co-authored-by: ai-sdk-factory <308175966+ai-sdk-factory@users.noreply.github.com>
    Co-authored-by: Gregor Martynus <39992+gr2m@users.noreply.github.com>
    3 people authored Sep 29, 2026
    Configuration menu
    Copy the full SHA
    ab0b94b View commit details
    Browse the repository at this point in the history
  4. [v6] chore(ai): raise bundle size limit to 630 KB (#21802)

    ## Background
    
    The v6 browser bundle reached 625.71 KiB and exceeded the 625 KiB budget
    in
    https://github.com/vercel/ai/actions/runs/36625796543/job/109604503194.
    
    ## Summary
    
    Raise the v6 bundle budget from 625 to 630 KiB, following the release
    branch established 5 KiB increments. Current bundles measure 623.14 KiB
    for Node and 625.71 KiB for browsers.
    
    Only the CI measurement script changes; published runtime code is
    unaffected, so no changeset is needed.
    
    ## Validation
    
    - `pnpm exec turbo build --filter=ai^...`
    - `pnpm -C packages/ai check-bundle-size`
    - `pnpm type-check:full`
    - `pnpm check`
    - `git diff --check`
    gr2m authored Sep 29, 2026
    Configuration menu
    Copy the full SHA
    c937f88 View commit details
    Browse the repository at this point in the history
  5. Backport: fix: report azure deepseek cached input tokens (#21812)

    This is an automated backport of #21811 to the release-v6.0 branch. FYI
    @jeremyphilemon
    
    Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
    github-actions[bot] authored Sep 29, 2026
    Configuration menu
    Copy the full SHA
    f6a20b4 View commit details
    Browse the repository at this point in the history

Commits on Sep 30, 2026

  1. Version Packages (#21670)

    This PR was opened by the [Changesets
    release](https://github.com/changesets/action) GitHub action. When
    you're ready to do a release, you can merge this and the packages will
    be published to npm automatically. If you're not ready to do a release
    yet, that's fine, whenever you add more changesets to release-v6.0, this
    PR will be updated.
    
    
    # Releases
    ## ai@6.0.297
    
    ### Patch Changes
    
    - 8349396: fix(ai): preserve hydrated partial static tool input across
    stream resumptions
    - ab0b94b: fix(ai): keep idle UI message streams open with optional SSE
    heartbeats
    - ce660b0: Clarify that provider-executed tool execution errors bypass
    the UI stream's `onError` callback to preserve provider error data.
    Stream errors and invalid tool calls still use the callback. Runtime
    behavior is unchanged.
    - 850d4d5: Encode chat IDs in default stream reconnection URLs so
    slashes, query delimiters, and fragments stay within the ID. Reject
    standalone `.` and `..` IDs before fetching. Custom URLs returned by
    `prepareReconnectToStreamRequest` remain unchanged.
    - cdc5b56: Preserve prototype-named tools, providers, and provider
    metadata as own properties without changing lookup object prototypes.
    Prevent inherited names from resolving as registered providers or
    causing image metadata aggregation to fail.
    - d4203d2: Prevent automatic chat resumption when completed tool output
    is followed by terminal text without a completed stream state, while
    preserving resumption after completed model text.
    - Updated dependencies [4972874]
    - Updated dependencies [03e5a25]
      - @ai-sdk/gateway@3.0.206
    ## @ai-sdk/amazon-bedrock@4.0.187
    
    ### Patch Changes
    
    - Updated dependencies [4972874]
      - @ai-sdk/openai@3.0.121
    ## @ai-sdk/angular@2.0.298
    
    ### Patch Changes
    
    - Updated dependencies [8349396]
    - Updated dependencies [ab0b94b]
    - Updated dependencies [ce660b0]
    - Updated dependencies [850d4d5]
    - Updated dependencies [cdc5b56]
    - Updated dependencies [d4203d2]
      - ai@6.0.297
    ## @ai-sdk/azure@3.0.129
    
    ### Patch Changes
    
    - Updated dependencies [4972874]
    - Updated dependencies [f6a20b4]
      - @ai-sdk/openai@3.0.121
      - @ai-sdk/deepseek@2.0.70
    ## @ai-sdk/deepseek@2.0.70
    
    ### Patch Changes
    
    - f6a20b4: fix cached input token reporting for OpenAI-compatible
    DeepSeek responses
    ## @ai-sdk/gateway@3.0.206
    
    ### Patch Changes
    
    - 4972874: feat(openai): add GPT-6.1 Sol model support
    - 03e5a25: Backport: chore(provider/gateway): update gateway model
    settings files
    ## @ai-sdk/langchain@2.0.305
    
    ### Patch Changes
    
    - Updated dependencies [8349396]
    - Updated dependencies [ab0b94b]
    - Updated dependencies [ce660b0]
    - Updated dependencies [850d4d5]
    - Updated dependencies [cdc5b56]
    - Updated dependencies [d4203d2]
      - ai@6.0.297
    ## @ai-sdk/llamaindex@2.0.297
    
    ### Patch Changes
    
    - Updated dependencies [8349396]
    - Updated dependencies [ab0b94b]
    - Updated dependencies [ce660b0]
    - Updated dependencies [850d4d5]
    - Updated dependencies [cdc5b56]
    - Updated dependencies [d4203d2]
      - ai@6.0.297
    ## @ai-sdk/mcp@1.0.89
    
    ### Patch Changes
    
    - cdc5b56: Preserve prototype-named tools, providers, and provider
    metadata as own properties without changing lookup object prototypes.
    Prevent inherited names from resolving as registered providers or
    causing image metadata aggregation to fail.
    ## @ai-sdk/openai@3.0.121
    
    ### Patch Changes
    
    - 4972874: feat(openai): add GPT-6.1 Sol model support
    ## @ai-sdk/react@3.0.300
    
    ### Patch Changes
    
    - Updated dependencies [8349396]
    - Updated dependencies [ab0b94b]
    - Updated dependencies [ce660b0]
    - Updated dependencies [850d4d5]
    - Updated dependencies [cdc5b56]
    - Updated dependencies [d4203d2]
      - ai@6.0.297
    ## @ai-sdk/rsc@2.0.297
    
    ### Patch Changes
    
    - Updated dependencies [8349396]
    - Updated dependencies [ab0b94b]
    - Updated dependencies [ce660b0]
    - Updated dependencies [850d4d5]
    - Updated dependencies [cdc5b56]
    - Updated dependencies [d4203d2]
      - ai@6.0.297
    ## @ai-sdk/svelte@4.0.297
    
    ### Patch Changes
    
    - Updated dependencies [8349396]
    - Updated dependencies [ab0b94b]
    - Updated dependencies [ce660b0]
    - Updated dependencies [850d4d5]
    - Updated dependencies [cdc5b56]
    - Updated dependencies [d4203d2]
      - ai@6.0.297
    ## @ai-sdk/vue@3.0.297
    
    ### Patch Changes
    
    - Updated dependencies [8349396]
    - Updated dependencies [ab0b94b]
    - Updated dependencies [ce660b0]
    - Updated dependencies [850d4d5]
    - Updated dependencies [cdc5b56]
    - Updated dependencies [d4203d2]
      - ai@6.0.297
    
    Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
    github-actions[bot] authored Sep 30, 2026
    Configuration menu
    Copy the full SHA
    76a2575 View commit details
    Browse the repository at this point in the history
Loading