Hi! 👋
Version: @convex-dev/agent@0.6.1, ai@6.0.142
Thanks for all you do! It's been quite an experience moving to convex.
My issue:
When a tool call fails, AI SDK v6 returns it as a tool-error content part (not tool-result).
willContinue only counts step.toolResults, so it sees fewer results than calls and stops even though the step actually completed. This causes agents to stop mid-work when any tool errors occur during parallel execution.
in File: src/client/utils.ts:13
// line 13 — currently:
if (step.toolCalls.length > step.toolResults.length) return false;
// Ideally would be something like:
const completedOutputs = step.content?.filter(
(p) => p.type === "tool-result" || p.type === "tool-error",
).length ?? step.toolResults.length;
if (step.toolCalls.length > completedOutputs) return false;
Hi! 👋
Version:
@convex-dev/agent@0.6.1,ai@6.0.142Thanks for all you do! It's been quite an experience moving to convex.
My issue:
When a tool call fails, AI SDK v6 returns it as a
tool-errorcontent part (nottool-result).willContinueonly counts step.toolResults, so it sees fewer results than calls and stops even though the step actually completed. This causes agents to stop mid-work when any tool errors occur during parallel execution.in File:
src/client/utils.ts:13