Session

Your AI Agent Isn't Crashing. It's Bleeding Tokens

Your agent does not crash. A tool returns a huge log dump, the window fills, and the answer gets worse with no error. A slow API holds the agent until the caller gives up. A vague tool reply makes it call the same tool again and again.

Each leak has a fix you can rerun: keep large output out of the context window behind a short reference, bound slow MCP tools with a timeout or a job id, and stop loops with clear tool states and a hook that caps calls.


What you'll learn:
• A way to tell the leaks apart from what the trace shows
• Large tool output kept out of the window behind a short reference
• A tool timeout for slow MCP tools, and a job id when the work outlasts the caller
• Clear tool replies plus a hook that caps repeat calls
• Open source code for every fix

Outline:
• How an agent wastes tokens without an error
• Big tool output: keep it out of the window
• Slow tools: stop waiting on them
• Repeated calls: tell the agent it is done
• Which fix for which leak, and resources

Elizabeth Fuentes Leone

Developer Advocate

San Francisco, California, United States

Actions

Please note that Sessionize is not responsible for the accuracy or validity of the data provided by speakers. If you suspect this profile to be fake or spam, please let us know.

Jump to top