agent is calling same tool 3 times with slightly different args each loop
Running claude 3.5 sonnet with filesystem tools (read_file, list_directory, write_file). When agent cant find a file it tries: 1. read_file with original path 2. read_file with ./ prefix 3. read_file with absolute path All three fail but it burns context before giving up. Is there way to tell agent "if tool fails, dont retry with variations"? Or should I just catch this in the tool description?
need the tool schema. also check if the model is getting different results back each time and interpreting that as "i should try again with slightly different args". seen this with file search tools where the schema said "search query" but didn't specify it should be a single attempt
ok so this is the classic tool loop problem. post your tool schema and also check if the responses from each call are actually different - sometimes the tool returns slightly different data each time and the model interprets that as progress
lol ya this is the clasic tool loop thing. we hit it with a file search tool and it turned out the tool was retunring slightly diferent results each time (timestamps changed, so the model thought "oh new data, let me search again"). also check if your tool description says something vague like "search for files" - if its too vauge the model will just keep retrying hoping for better results
check server logs for timestamp drift
lol ya this is the clasic tool loop. we had this with a databse query tool and it turned out the tool was returning slighty different timestamps each call so the model thought the data was changing and kept retrying. check your tool responses for any non-deterministic fields like timestamps or uuids and strip them out before returning to the agent
iirc this happens when the tool description is ambiguous and the model thinks retrying with slightly different args will work. post your tool schema?
need to see the tool schema and also the exact responses from each loop. also what model r u using - some models do this more than others