Fetching from the wire…
Public story · 2026-08-03 · high
The TypeScript SDK lets developers cap tool calls per turn and per session instead of writing their own counters.
Why now: The tool-call caps shipped in a TanStack/ai release, dated as of August 3.
TanStack shipped bounded tool-call limits in TanStack/ai, its provider-agnostic TypeScript SDK for OpenAI, Anthropic, Gemini, and Ollama, per the project's GitHub release.
The library has 2,953 stars and adapters for React, Vue, Svelte, and Solid. That reaches a wide slice of teams wiring tool calls into production agents. Before this, stopping a runaway loop meant writing a counter yourself and hoping you didn't miss an edge case.
AgentLoopState exposes toolCallCount and lastTurnToolCallCount so a running agent can report its own usage. The method maxToolCalls(n) caps the cumulative number of tool calls across a whole session. Separately, chat({ maxToolCallsPerTurn }) caps how many calls can run in parallel within a single turn.
That state sits inside the agent loop, not bolted onto the API client as a separate wrapper. A developer can inspect toolCallCount mid-run and choose to bail, warn, or throttle the remaining budget instead of hitting a wall with no warning.
The release notes don't say what happens when a call hits the cap mid-task. Does the loop return a partial result, throw, or truncate the last turn silently? That's worth checking before shipping this in anything user-facing, since a silent truncation on a multi-step task is worse than no cap at all.
Whether Vercel's AI SDK or LangChain.js add an equivalent cap next is worth watching. A runaway tool loop burning through a budget is a support ticket every team running tool-calling in production has probably already filed.
Each link below shares sources, entities, or timing with this story.
Anthropic partners with OpenAI / Shared entities / Same source domain / Shared topic / Earlier coverage / Tension
Linked by a graph relationship (Anthropic partners with OpenAI); both cover Anthropic, Gemini, OpenAI, TanStack; reported by the same outlet (github.com).
cherry-studio supports Anthropic / Shared entities / Same source domain / Shared topic / Earlier coverage
Linked by a graph relationship (cherry-studio supports Anthropic); both cover Anthropic, Gemini, Ollama, OpenAI; reported by the same outlet (github.com).
Anthropic partners with OpenAI / Shared entities / Same source domain / Earlier coverage / Tension
Linked by a graph relationship (Anthropic partners with OpenAI); both cover Anthropic, Gemini, Ollama, OpenAI; reported by the same outlet (github.com).
Anthropic released Claude Code Security / Shared entities / Same source domain / Earlier coverage
Linked by a graph relationship (Anthropic released Claude Code Security); both cover Anthropic, Gemini, Ollama, React; reported by the same outlet (github.com).
Anthropic partners with OpenAI / Shared entities / Same source domain / Earlier coverage / Tension
Linked by a graph relationship (Anthropic partners with OpenAI); both cover Gemini, Ollama, OpenAI; reported by the same outlet (github.com).
Anthropic partners with Block / Shared entities / Shared topic / Earlier coverage / Tension
Linked by a graph relationship (Anthropic partners with Block); both cover Anthropic, Gemini, OpenAI; overlapping topics (agent, anthropic).
Anthropic partners with OpenAI / Shared entities / Shared topic / Earlier coverage
Linked by a graph relationship (Anthropic partners with OpenAI); both cover Anthropic, Ollama, OpenAI; overlapping topics (agent, answer, anthropic).
Anthropic partners with OpenAI / Shared entities / Same source domain / Shared topic / Earlier coverage / Tension
Linked by a graph relationship (Anthropic partners with OpenAI); both cover Anthropic, OpenAI; reported by the same outlet (github.com).