Tool Name Correction
GitAuto auto-corrects when the model calls a non-existent tool name by mapping common mistakes to their correct counterparts. The model hallucinates tool names that sound plausible but do not exist in the agent's tool set, which would otherwise crash the agent loop.
Why This Exists
The model has a tendency to invent tool names based on what it thinks should exist rather than what actually exists. For example, it might call create_remote_file when the real tool is write_and_commit_file, or call edit_file when the real tool is apply_diff_to_file. Without correction, these calls fail with a "tool not found" error, wasting an iteration and sometimes causing the agent to give up entirely.
Why Models Invent Tool Names
Models predict the most likely next token. If a tool is conceptually "apply a diff to a file," the model generates a name that sounds right (apply_diff, patch_file, edit_file) rather than the exact registered name. The model has seen thousands of different tool and function names in training and picks the most natural-sounding one, not the one that matches the schema. Training data contains thousands of different function and tool naming conventions, so the model has learned that tool names are flexible - only structured tool-use APIs require exact matches.
How It Works
GitAuto maintains a mapping of commonly hallucinated tool names to their correct equivalents. When the model emits a tool call with an unrecognized name, the system checks the mapping and silently substitutes the correct tool name before executing. This happens transparently, requiring no additional API calls or agent iterations.
create_remote_file → write_and_commit_file
edit_file → apply_diff_to_file
Related Features
- Tool Argument Correction - Fixes when the right arguments are sent to the wrong tool
- Sanitize Tool Arguments - Strips malformed XML from tool arguments
Need Help?
Have questions or suggestions? We're here to help you get the most out of GitAuto.
Contact us with your questions or feedback!