AI SDK 7.0.181 暴露工具循环停止原因、单次调用警告,并收紧提取遥测元数据
AI SDK 7.0.181 为 generateText、streamText 与 ToolLoopAgent 增加单次调用 onWarning,并通过 stoppedBy 区分模型结束、停止条件、无执行器工具与待审批。它还让延迟 steering 保留真实结束原因,并在提取遥测中移除文本和文件部件的 providerOptions。
为什么值得关注
生成式界面需要知道一次工具循环为什么停下,才能分别呈现“等待审批”“没有执行器”“命中停止条件”或模型结束;调用级警告可把不支持的设置与转换问题交给具体界面处理。遥测过滤则降低供应商元数据离开宿主边界的风险。
技术细节
stoppedBy 出现在 generateText/streamText 结果、onEnd 与 finish 流部件,值为 model、stop-condition、tool-without-execute 或 approval;finishReason 仍表示最后一次模型调用。onWarning 覆盖三个文本/代理入口,设置回调后该次调用不再走全局日志。steering 修复让延迟消息保留 aborted 或 error 等结束原因;提取遥测在状态准备前后删除文本与文件部件的 providerOptions。
适合哪些读者
构建工具循环、审批界面、流式对话、运行观测与隐私边界的团队。
原始来源
- AI SDK 7.0.181 official release and signed commits ↗github.com
- Late-steering end-reason fix ↗github.com
- stoppedBy implementation and tests ↗github.com
- Extraction telemetry provider-metadata filtering ↗github.com
- Per-call warning callback implementation and tests ↗github.com
修订与更正记录 (1)
— Complete primary-source evidence supports publication; the existing Bel review is revised in place with the paper's actual first-submission date.