Skip to content

DurableAgent: single tool exception breaks entire agent stream #1180

@iNishant

Description

@iNishant

Problem

In DurableAgent.stream(), tool calls are executed via Promise.all. Inside executeTool, only FatalError is caught and converted to an error-text result — any other exception re-throws, causing Promise.all to reject and killing the entire agent stream.

This differs from the AI SDK's streamText, where individual tool errors are returned as error results to the model, allowing recovery.

Expected behaviour

Non-fatal tool exceptions should be converted to per-tool error results and sent back to the model so the agent can continue. Only FatalError / AbortError should break the stream.

Versions

Package Version
@workflow/ai 4.0.1-beta.51
workflow 4.0.1-beta.50
ai (Vercel AI SDK) 6.0.49

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions