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.84
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.85
Choose a head ref
  • 14 commits
  • 216 files changed
  • 10 contributors

Commits on Sep 23, 2026

  1. Backport: fix: Prevent MCP OAuth from deleting or replacing pre-regis…

    …tered clients after authentication errors. (#21367)
    
    This is an automated backport of #21029 to the release-v6.0 branch. FYI
    @ai-sdk-factory[bot]
    This backport has conflicts that need to be resolved manually.
    
    ### `git cherry-pick` output
    
    ```
    Auto-merging content/docs/03-ai-sdk-core/16-mcp-tools.mdx
    CONFLICT (content): Merge conflict in content/docs/03-ai-sdk-core/16-mcp-tools.mdx
    Auto-merging packages/mcp/src/tool/oauth.test.ts
    CONFLICT (content): Merge conflict in packages/mcp/src/tool/oauth.test.ts
    Auto-merging packages/mcp/src/tool/oauth.ts
    error: could not apply 7fc2bc1... fix: Prevent MCP OAuth from deleting or replacing pre-registered clients after authentication errors. (#21029)
    hint: After resolving the conflicts, mark them with
    hint: "git add/rm <pathspec>", then run
    hint: "git cherry-pick --continue".
    hint: You can instead skip this commit with "git cherry-pick --skip".
    hint: To abort and get back to the state before "git cherry-pick",
    hint: run "git cherry-pick --abort".
    hint: Disable this message with "git config set advice.mergeConflict false"
    ```
    
    
    Fixes #21020
    
    ---------
    
    Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
    Co-authored-by: Aayush Kapoor <aayushkapoor34@gmail.com>
    github-actions[bot] and aayush-kapoor authored Sep 23, 2026
    Configuration menu
    Copy the full SHA
    03c91a0 View commit details
    Browse the repository at this point in the history
  2. [v6.0] fix: preserve schema defaults and transformations in validated…

    … UI messages (#21335)
    
    ## Background
    
    UI message validation returned original metadata and custom-data values
    after successful schema parsing, losing defaults, coercions, and
    transformations and causing runtime values to contradict their
    TypeScript types.
    
    ## Root Cause
    
    The shared validation implementation awaited validateTypes for metadata
    and custom data but ignored its parsed return values, as confirmed by
    the reproduction retaining strings and missing defaults despite
    successful validation.
    
    ## Summary
    
    Assigned parsed metadata and custom-data outputs back to the cloned
    validated messages and added a patch changeset for the ai package.
    
    ## Testing
    
    Added regression tests covering metadata defaults, async
    transformations, data coercion, safe validation output, runtime number
    usage, and caller input immutability.
    
    ## End-to-end Validation
    
    - `pnpm -C examples/ai-functions exec tsx
    src/reproduction/validate-ui-messages-schema-output.ts` via immutable
    replay exited successfully, preserved all parsed outputs, and emitted no
    reproduction signal.
    
    ## Related Issues
    
    Fixes #21122
    
    Closes #21320
    
    Backport of #21128
    
    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: brennanbutler01 <64561607+brennanbutler01@users.noreply.github.com>
    Co-authored-by: Gregor Martynus <39992+gr2m@users.noreply.github.com>
    4 people authored Sep 23, 2026
    Configuration menu
    Copy the full SHA
    7c41f5e View commit details
    Browse the repository at this point in the history
  3. [v6.0] fix: preserve useObject cancellation state when an older overl…

    …apping request finishes (#21340)
    
    ## Background
    
    Overlapping React useObject submissions allowed an older request to
    finish while a newer request was active, incorrectly disabling loading
    state and preventing stop() or clear() from aborting the newer stream.
    
    ## Root Cause
    
    The stream close handler unconditionally cleared isLoading and
    abortControllerRef. Regression tests and the original reproduction
    confirmed that an older stream therefore discarded the newer stream's
    controller.
    
    ## Summary
    
    The close handler now clears request state only when its abort
    controller is still current. Added a patch changeset for @ai-sdk/react.
    
    ## Testing
    
    Added overlapping-request regression cases covering both stop() and
    clear(), including loading state, stream cancellation, and final object
    state.
    
    The release-branch streaming-abort tests now wait for the relevant text
    or tool-call chunk to reach the output before triggering cancellation.
    This removes the stream scheduling assumptions that caused five snapshot
    failures on Node 24.21.0.
    
    Local validation:
    - All 374 `stream-text` tests passed on Node 20, 22, and 24.21.0, and in
    the edge runtime on Node 24.21.0.
    - All 18 React `useObject` tests passed.
    - `pnpm type-check:full` and `pnpm check` passed.
    
    ## End-to-end Validation
    
    - `pnpm -C examples/ai-functions exec tsx
    src/reproduction/use-object-overlapping-stop.ts` via immutable replay
    exited successfully; both newer requests were aborted and retained the
    expected object state.
    
    ## Related Issues
    
    Fixes #21124
    
    Closes #21337
    
    Backport of #21135
    
    ---------
    
    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: brennanbutler01 <64561607+brennanbutler01@users.noreply.github.com>
    Co-authored-by: Nick Oates <58091943+n1ckoates@users.noreply.github.com>
    Co-authored-by: Gregor Martynus <39992+gr2m@users.noreply.github.com>
    5 people authored Sep 23, 2026
    Configuration menu
    Copy the full SHA
    da8b37a View commit details
    Browse the repository at this point in the history
  4. [v6.0] fix: OpenAI chat audio completions lose message.audio transcri…

    …pts (#21377)
    
    ## Background
    
    OpenAI gpt-audio Chat Completions returned content as null and the
    spoken words in message.audio.transcript, but @ai-sdk/openai produced
    empty generated text.
    
    ## Root Cause
    
    The chat response schema omitted message.audio, so Zod stripped the
    valid audio object before doGenerate processed it; the recorded response
    consequently produced no text while retaining other message fields.
    
    ## Summary
    
    Added audio transcript parsing to the OpenAI chat response schema and
    used the transcript as generated text when regular message content is
    empty, while preserving coexisting tool calls.
    
    ## Testing
    
    Added regression coverage for an audio transcript returned with null
    content and a coexisting tool call, and added a patch changeset for
    @ai-sdk/openai.
    
    ## End-to-end Validation
    
    - `replay_original_reproduction`: the immutable recorded response
    completed successfully with the transcript exposed as text; status was
    `no-longer-reproduces`.
    - `pnpm -C examples/ai-functions exec tsx -e "<live gpt-audio-1.5
    validation>"`: OpenAI returned `content: null` and transcript `audio
    transcript validation`; generated text matched the transcript.
    
    ## Related Issues
    
    Fixes #21289
    
    Closes #21356
    
    Backport of #21338
    
    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: remorses <31321188+remorses@users.noreply.github.com>
    Co-authored-by: Gregor Martynus <39992+gr2m@users.noreply.github.com>
    4 people authored Sep 23, 2026
    Configuration menu
    Copy the full SHA
    a3e970b View commit details
    Browse the repository at this point in the history
  5. Backport: chore(provider/gateway): update gateway model settings file…

    …s v6 (#21285)
    
    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/35753288015)).
    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>
    Co-authored-by: Zachary <zachsnkrs@gmail.com>
    github-actions[bot] and ZYPX authored Sep 23, 2026
    Configuration menu
    Copy the full SHA
    ffb9507 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    f7f36d2 View commit details
    Browse the repository at this point in the history
  7. Backport: chore(provider/gateway): update gateway model settings file…

    …s v6 (#21388)
    
    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/35888046520)).
    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 23, 2026
    Configuration menu
    Copy the full SHA
    bbd0115 View commit details
    Browse the repository at this point in the history
  8. [v6.0] fix: support approving, resuming, and retrying tool approvals …

    …from earlier messages (#21396)
    
    ## Background
    
    Tool approvals can remain open while later conversation turns are added,
    so decisions and resumed output must update the historical message
    owning the approval without truncating or reordering later messages.
    
    ## Root Cause
    
    AbstractChat updated approvals and initialized resumed stream state from
    only the final message, making historical invocations unavailable to
    result processing. Failed partial streams also restored an obsolete
    message ID. The immutable reproduction and historical,
    competing-approval, hydration, and retry regressions confirmed these
    defects.
    
    ## Summary
    
    Approval responses now update the owning historical assistant message
    while preserving metadata and later turns. Manual, automatic, hydrated,
    and retried continuations use the correct historical context, and failed
    retries retain the target's current message ID. The ai patch changeset
    remains, and the unrelated issue #20951 reproduction matches the target
    base.
    
    ## Testing
    
    Regression coverage verifies historical approval and rejection, resumed
    outputs, later-message and metadata preservation, competing approvals,
    hydrated and automatic continuation, and retry after streamed ID
    replacement. All 47 chat tests passed in Node and Edge; full type
    checking, package build, formatting, linting, and both reproductions
    passed.
    
    ## End-to-end Validation
    
    - `pnpm -C examples/ai-functions exec tsx
    src/reproduction/issue-21193-earlier-tool-approval.ts` via
    `replay_original_reproduction`: exited 0 and reported that earlier
    approvals and resumed results succeeded.
    - `pnpm -C examples/ai-functions exec tsx
    src/reproduction/issue-20951-generated-file-url.ts`: exited 0 and
    reported that the generated-file URL issue did not reproduce.
    
    ## Related Issues
    
    Fixes #21193
    
    Closes #21391
    
    Backport of #21203
    
    ---------
    
    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 23, 2026
    Configuration menu
    Copy the full SHA
    7f42b4d View commit details
    Browse the repository at this point in the history
  9. [v6.0] fix: preserve Google embedMany content alignment across automa…

    …tic batches (#21397)
    
    ## Background
    
    Google embedMany supports one multimodal content entry per value, but
    calls exceeding the 100-value provider limit failed instead of
    automatically batching aligned values and content.
    
    ## Root Cause
    
    Core batched the values but reused the full providerOptions object for
    every batch, so Google validated the complete content array against each
    smaller value chunk. The original 101-value reproduction failed before
    any request and now completes successfully.
    
    ## Summary
    
    Added an experimental provider-options transformation capability in
    provider-utils, applied original batch index ranges in embedMany,
    preserved the capability through embedding-model wrappers, and made
    Google validate and slice per-value content for each batch. Added patch
    changesets for ai, Google, and provider-utils without dependency or
    configuration changes.
    
    ## Testing
    
    Coverage verifies index alignment through sequential, parallel,
    byte-limited, wrapped, retried, null-content, and middleware-normalized
    batches, plus mismatch validation. All 89 focused tests passed in both
    Node and Edge; formatting, linting, and full type checking also passed.
    
    ## End-to-end Validation
    
    - `pnpm -C examples/ai-functions exec tsx
    src/reproduction/google-embed-many-content-batching.ts` — exact original
    synthetic reproduction exited 0 and retained all 101 value/content
    pairings without the bug signal.
    
    ## Related Issues
    
    Fixes #21095
    
    Closes #21392
    
    Backport of #21143
    
    ---------
    
    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 23, 2026
    Configuration menu
    Copy the full SHA
    069a945 View commit details
    Browse the repository at this point in the history
  10. [v6] chore(ai): adjust bundle size budget for recent fixes (#21399)

    ## Background
    
    The v6 browser bundle reached 620.47 KB after the historical
    tool-approval fix (#21396), then 620.72 KB after #21397. Both exceeded
    the 620 KB budget and failed CI:
    
    - https://github.com/vercel/ai/actions/runs/35898714869
    - https://github.com/vercel/ai/actions/runs/35903439574
    
    ## Summary
    
    Raise the v6 bundle budget from 620 to 625 KB, following this release
    branch's existing 5 KB increments (#19298). Current bundles measure
    618.12 KB for Node and 620.72 KB for browsers. This accommodates the
    recent fixes while retaining a bounded size check.
    
    Correct the failure message to point to the `LIMIT` constant in this
    script. The previously suggested GitHub Actions variable is not read by
    the check.
    
    Only the CI measurement script changes; published runtime code is
    unaffected, so no changeset is needed.
    
    ## Validation
    
    - Built the `ai` workspace dependencies with `pnpm exec turbo build
    --filter='ai^...'`.
    - `pnpm -C packages/ai check-bundle-size` passes for Node and browser
    bundles.
    - `pnpm type-check:full` passes.
    - `pnpm check` passes.
    - `git diff --check` passes.
    
    ## Checklist
    
    - [x] All commits are signed (PRs with unsigned commits cannot be
    merged)
    - [ ] Tests have been added / updated (for bug fixes / features)
    - [ ] Documentation has been added / updated (for bug fixes / features)
    - [ ] 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)
    gr2m authored Sep 23, 2026
    Configuration menu
    Copy the full SHA
    e1dd5c4 View commit details
    Browse the repository at this point in the history
  11. [v6.0] fix: manual tool approvals reject or mutate transformed inputs…

    … across model and UI continuations (#21408)
    
    ## Problem
    
    Manual tool approvals rejected valid inputs after schema transforms. For
    example, a schema that converts `{ count: "3" }` to `{ count: 3 }`
    produced an approval that failed when the SDK validated the transformed
    number against the original string schema.
    
    ## Changes
    
    - Preserve original schema input when it differs from the approved
    input, including persisted ModelMessage and UIMessage continuations.
    - Reconstruct schema output and input refinement before execution,
    require it to match the approved input, and retain the approved call
    unchanged. Missing metadata cannot cause a signed or unsigned input to
    be transformed into a different operation.
    - Check that transformed UI tool inputs match their reconstructed schema
    output, including configured input refinement. Preserve failed history
    as dynamic tool parts when its input cannot be validated.
    - Share the repeated UI approval schemas to reduce duplication and keep
    bundle sizes within the existing limits.
    - Document persistence requirements and the fact that original input,
    including fields removed by transforms, is included in approval
    metadata.
    
    ## Validation
    
    - Focused Node tests: 970 passed, 3 skipped.
    - Focused Edge tests: 970 passed, 3 skipped.
    - Regression coverage includes signed non-idempotent transforms with
    preserved or omitted metadata, unchanged approved values, mismatched UI
    values and types across approval states, and persisted UI continuation.
    - `pnpm type-check:full` passed.
    - `pnpm check` passed.
    - Bundle size checks passed without raising limits.
    
    Fixes #21091
    Closes #21093
    
    ## Related Issues
    
    Closes #21407
    
    Backport of #21130
    
    ---------
    
    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 23, 2026
    Configuration menu
    Copy the full SHA
    d1a36d2 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    be4ca16 View commit details
    Browse the repository at this point in the history
  13. [v6.0] fix: Prevent retries for early OpenAI insufficient-quota strea…

    …m errors (#21348)
    
    ## Background
    
    OpenAI insufficient-quota errors received before streamed output were
    retried three times, delaying failure and surfacing RetryError instead
    of one non-retryable APICallError.
    
    ## Root Cause
    
    createOpenAIStreamError assigned status 429 but omitted the existing
    stream-error retry classification, causing APICallError to infer that
    quota errors were retryable. The recorded insufficient_quota fixture
    confirmed isRetryable was incorrectly true.
    
    ## Summary
    
    Propagated stream-error retryability into APICallError, updated the
    insufficient-quota regression assertion, added an OpenAI patch
    changeset, and removed reproduction-only artifacts.
    
    ## Testing
    
    Updated the existing Responses API stream-error fixture test to require
    isRetryable: false for insufficient_quota errors.
    
    ## End-to-end Validation
    
    - `replay_original_reproduction`: passed with one fetch and a
    non-retryable APICallError in 77 ms; classified as no-longer-reproduces.
    
    ## Related Issues
    
    Fixes #21345
    
    Closes #21347
    
    ---------
    
    Co-authored-by: ai-sdk-factory <308175966+ai-sdk-factory@users.noreply.github.com>
    Co-authored-by: dor-sr <7157779+dor-sr@users.noreply.github.com>
    3 people authored Sep 23, 2026
    Configuration menu
    Copy the full SHA
    57256a0 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    ba213ad View commit details
    Browse the repository at this point in the history
Loading