Skip to content

LLMs loop indefinitely on miscalled tool synonyms (e.g. search, find, cat) #14087

Description

@sirus20x6

Problem

The existing experimental_repairToolCall handler normalizes case and separators (e.g. todo_write → todowrite), but many models consistently call tools by common synonyms that don't match any tool name even after normalization — search instead of grep, find instead of glob, cat instead of read, etc.

When this happens, the tool call falls through to the "invalid" fallback, and the model retries the same synonym in an infinite loop:

Tool miscall loop

Expected behavior

Common tool synonyms should be resolved automatically by the repair handler, similar to how case/separator normalization already works. Users should also be able to define custom alias mappings via config for their specific setups.

Related

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions