Session

Your Agent Retries Because the Tool Never Said Done

Your agent searches flights. The tool lists a few prices, then adds that more results may be available. The agent cannot tell the search is finished, so it searches again. Nothing crashes, but every repeat costs tokens.

The fix starts in the tool: end every answer with a clear done or failed result, so the agent knows when to stop. Then add hooks as safety nets: a duplicate-call hook blocks identical repeats, and a cap limits how often each tool can run. See which guard barely helps.


What you'll learn:
• A way to spot tool answers an agent cannot read as finished
• Tool responses that end in a clear done or failed result
• A hook that blocks identical repeat calls before they run, and where it falls short
• A per-tool call cap that stops a runaway loop
• An order for adding them: fix the answer first, then add the guards
• The open source demo, so you can count the calls on your own agent

Outline:
• Why the agent keeps calling the same tool
• Make every tool answer end in done or failed
• Block identical repeat calls with a hook
• Cap how many times each tool can run
• Which fix to add first
• Resources and Q&A

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