AI SDK 7.0.149 收紧审批去重、禁用工具与断流边界
10 月 22 日发布的 AI SDK 7.0.149 只接受每个工具调用的首个审批响应,修复 toolChoice: none 仍可能执行工具的问题,并新增 interrupted 结束原因以阻止断流后的工具与 UI 继续运行。
为什么值得关注
生成式界面的审批、工具禁用和断流状态都属于执行权限边界;重复审批、被忽略的禁用信号或把不完整流当正常完成,都可能让界面显示与真实副作用脱节。
技术细节
重复或冲突的审批响应现在按工具调用只取第一个,避免同一工具执行两次,或同时出现执行与拒绝。toolChoice: none 会转发到 Hugging Face Responses API,并在 generateText、streamText 和 WorkflowAgent 本地执行前拒绝工具调用;流式工具片段也不会下发给客户端。新的 interrupted 结束原因保留部分输出,但停止工具执行、代理续跑、自动 UI 后续以及迟到的工具结果和审批。
适合哪些读者
使用 AI SDK 工具审批、流式 UI、WorkflowAgent 或自定义 finishReason 映射的团队
原始来源
- Vercel AI SDK official release and commits ↗github.com
- toolChoice none enforcement commit ↗github.com
- Interrupted finish-reason commit ↗github.com
- Approval-response deduplication commit ↗github.com
修订与更正记录 (1)
— Official October 22 release and three linked commits establish a new execution-boundary event; project-reported limitations and migration risk are preserved.