Skip to content

fix(ai): fix lastAssistantMessageIsCompleteWithApprovalResponses to no longer ignore providerExecuted tool approvals#14323

Merged
felixarntz merged 5 commits intomainfrom
fa/fix-ui-approval-helper-ignoring-provider-executed-tools
Apr 10, 2026
Merged

fix(ai): fix lastAssistantMessageIsCompleteWithApprovalResponses to no longer ignore providerExecuted tool approvals#14323
felixarntz merged 5 commits intomainfrom
fa/fix-ui-approval-helper-ignoring-provider-executed-tools

Conversation

@felixarntz
Copy link
Copy Markdown
Collaborator

Summary

lastAssistantMessageIsCompleteWithApprovalResponses() so far ignores providerExecuted tools. There's no good reason for that, and we already had to work around it in one of the Next.js E2E examples.

This PR removes the condition so that providerExecuted tools are also considered.

Manual Verification

run the modified example, where the custom workaround helper was replaced with the function from ai

Checklist

  • 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)
  • I have reviewed this pull request (self-review)

Related Issues

includes a follow-up cleanup of an unused variable from #14289 (which for some reason wasn't flagged by CI in that PR)

@tigent tigent bot added ai/core core functions like generateText, streamText, etc. Provider utils, and provider spec. ai/provider related to a provider package. Must be assigned together with at least one `provider/*` label ai/ui anything UI related bug Something isn't working as documented provider/openai Issues related to the @ai-sdk/openai provider labels Apr 10, 2026
@felixarntz felixarntz added the backport Admins only: add this label to a pull request in order to backport it to the prior version label Apr 10, 2026
@felixarntz felixarntz merged commit 6866afe into main Apr 10, 2026
18 checks passed
@felixarntz felixarntz deleted the fa/fix-ui-approval-helper-ignoring-provider-executed-tools branch April 10, 2026 15:30
vercel-ai-sdk bot pushed a commit that referenced this pull request Apr 10, 2026
@vercel-ai-sdk vercel-ai-sdk bot removed the backport Admins only: add this label to a pull request in order to backport it to the prior version label Apr 10, 2026
@vercel-ai-sdk
Copy link
Copy Markdown
Contributor

vercel-ai-sdk bot commented Apr 10, 2026

⚠️ Backport to release-v6.0 created but has conflicts: #14327

@vercel-ai-sdk
Copy link
Copy Markdown
Contributor

vercel-ai-sdk bot commented Apr 10, 2026

🚀 Published in:

Package Version
ai 7.0.0-beta.79
@ai-sdk/angular 3.0.0-beta.79
@ai-sdk/langchain 3.0.0-beta.79
@ai-sdk/llamaindex 3.0.0-beta.79
@ai-sdk/otel 1.0.0-beta.25
@ai-sdk/react 4.0.0-beta.79
@ai-sdk/rsc 3.0.0-beta.80
@ai-sdk/svelte 5.0.0-beta.79
@ai-sdk/vue 4.0.0-beta.79

felixarntz added a commit that referenced this pull request Apr 10, 2026
…ponses` to no longer ignore `providerExecuted` tool approvals (#14327)

This is an automated backport of #14323 to the release-v6.0 branch. FYI
@felixarntz
~~This backport has conflicts that need to be resolved manually.~~
Conflicts resolved.

### `git cherry-pick` output

```
Auto-merging packages/ai/src/generate-text/stream-text.ts
CONFLICT (content): Merge conflict in packages/ai/src/generate-text/stream-text.ts
error: could not apply 6866afe... fix(ai): fix `lastAssistantMessageIsCompleteWithApprovalResponses` to no longer ignore `providerExecuted` tool approvals (#14323)
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"
```

---------

Co-authored-by: Felix Arntz <felix.arntz@vercel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai/core core functions like generateText, streamText, etc. Provider utils, and provider spec. ai/provider related to a provider package. Must be assigned together with at least one `provider/*` label ai/ui anything UI related bug Something isn't working as documented provider/openai Issues related to the @ai-sdk/openai provider

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants