OSS
TanStack AI Adds Bounded Tool-Call Fan-Out — maxToolCalls(n) and maxToolCallsPerTurn Cap Runaway Agent Loops
TanStack/ai (2,953 stars), the type-safe provider-agnostic TypeScript SDK spanning OpenAI, Anthropic, Gemini and Ollama with React, Vue, Svelte and Solid adapters, shipped agent-loop guardrails: AgentLoopState now exposes `toolCallCount` and `lastTurnToolCallCount`, a `maxToolCalls(n)` strategy caps cumulative calls, and `chat({ maxToolCallsPerTurn })` caps how many parallel calls execute in a single turn. This is a direct answer to the failure mode where an agent loop fans out unbounded tool invocations and burns a budget, and it lands as a first-class strategy rather than a user-implemented counter. The framework positions explicitly against Vercel AI SDK on vendor lock-in.
Source
↳ Follow the thread