AI SDK 7.0.154 让运行中的代理接收转向消息并闭合失败步骤
AI SDK 7.0.154 于 10 月 26 日发布实验性 steering:用户可在代理仍运行时排队追加消息,在下一步边界交付;新 onStepError、onError 与 onAbort 回调补齐无输出流和后续 provider 失败的生命周期记录。
为什么值得关注
生成式 UI 需要把用户在长任务中的改意、取消与修正纳入可见状态,同时让加载态、步骤轨迹和遥测在失败时可靠收尾。此次更新把中途输入和失败闭环放入核心运行循环,减少前端另造队列或留下永不结束步骤的需要。
技术细节
experimental_createSteering 可用于 generateText、streamText、ToolLoopAgent 和 createAgentUIStream。steer(message,{id}) 在当前步骤及其工具调用结束后的下一边界加入独立用户消息;等待消息可让本来结束的回答继续下一步,同一 id 重试返回首次结果。返回值明确区分 delivered 与 finished、stop-condition、waiting-for-tool-results、aborted、error 等未交付原因。onStepError 在已开始步骤尚未产出结果时关闭失败轨迹,并把 callId、provider、modelId、stepNumber 与错误交给回调;遥测事件另带 aiVersion。
适合哪些读者
构建可中途修正的生成式 UI、长任务代理、审批流程、聊天历史持久化与步骤遥测的前端和平台团队
原始来源
- Vercel AI SDK official release and commits ↗github.com
- Experimental steering implementation and tests ↗github.com
- Failed-step lifecycle callbacks and telemetry closure ↗github.com
- AI SDK version in telemetry events ↗github.com
修订与更正记录 (1)
— Official AI SDK release and signed commits confirm experimental mid-run steering, idempotent delivery outcomes, failed-step callbacks, telemetry versioning, and documented unsupported paths. It is a new release distinct from 7.0.153.