@ai-sdk/workflow@2.0.104
Vercel AI SDK released @ai-sdk/workflow@2.0.104 , aligning WorkflowAgent behavior with ToolLoopAgent regarding callbacks, message visibility in tools, step overrides, and token aggregation.
原始内容为英文;当前页面提供中文导航与来源说明,具体事实请以原文为准。
为什么值得关注
The 2.0.104 patch release for @ai-sdk/workflow introduces several behavioral bug fixes to align WorkflowAgent with ToolLoopAgent and general text generation methods: - Constructor Callbacks: WorkflowAgent now accepts onError and onAbort in its constructor, invoked prior to per-call callbacks. Errors thrown inside these handlers will not overwrite the original run result or error. - Tool Messages Sanitization: Tools invoked by WorkflowAgent no longer receive the system prompt or the current tool-call assistant message inside options.messages . Likewise, onToolExecutionStart and onToolExecutionEnd omit the system prompt. - Step Setting Scoping: Dynamic overrides returned by prepareStep (e.g., model , toolChoice , activeTools , generation settings) now scope solely to the active step rather than persisting across subsequent steps. - Usage Aggregation: WorkflowAgent.stream() now mirrors ToolLoopAgent token aggregation by retaining specific token details (such as cached and reasoning tokens) and preserving undefined values for unreported provider metrics instead of defaulting to 0 . Dependencies were also updated: @ai-sdk/provider-utils@5.0.81 and ai@7.0.172 .
可执行摘要
@ai-sdk/workflow@2.0.104 aligns WorkflowAgent with ToolLoopAgent . It adds onError and onAbort constructor callbacks, excludes system prompts and current tool call assistant messages from tool options.messages and execution callbacks, limits prepareStep settings overrides to the single step, and refines stream() totalUsage token aggregation.
- Agent 实用度
- 77/100
- 可信度
- 96%
- 机器格式
- JSON + Markdown
开发者应核对什么
- Verify tool implementations under WorkflowAgent do not rely on system prompts or the current assistant message in options.messages .
- Ensure prepareStep logic explicitly re-applies configuration overrides if they were intended to persist beyond a single step.
- Update dependency @ai-sdk/workflow to 2.0.104 alongside compatible core packages ( ai@7.0.172 ).