You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
DurableAgent.streamText kills the stream on tool input validation errors; core ai SDK recovers #1841
When an assistant tool call has a malformed input (bad JSON, or a value that fails the tool's inputSchema validation), DurableAgent.streamText throws out of executeTool, which propagates up through streamTextIterator and terminates the stream.
The core ai SDK handles the same failure differently: it converts the parse/validation failure into an invalid: true tool call, emits a tool-input-error UIMessage chunk, keeps the loop alive, and lets the model see the validator message on the next step so it can self-correct.
Expected behavior
Schema-shape failures should be recoverable — fed back to the model on the next step rather than killing the stream. Runtime zod validation throws are the normal feedback channel the model uses to fix an argument, so a single bad arg shouldn't end the turn.
This is also internally inconsistent: if the tool's execute function throws after parsing, the error is already converted to an error-text tool result and flows back to the model. Only the parse/validate path is fatal.
Relevant code
@workflow/ai 4.1.2 — executeTool in packages/ai/src/agent/durable-agent.ts (compiled dist/agent/durable-agent.js): after repairToolCall, the catch (parseError) block does throw parseError.
ai 6.0.134 — parseToolCall returns { invalid: true, error, … } and stream-text.ts emits a tool-input-error chunk:
Activity
NathanColosimo commentedon Jun 30, 2026
Should be fixed as a part of the next versions, let us know if still any issues! fixed in #2699 - will be backported soon to 4.x #2703 @iNishant