Skip to content

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

Closed as not planned

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

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Feb 18, 2026
  2. sirus20x6 commented on Feb 20, 2026

    @sirus20x6
    Author

    bump

  3. Mte90 commented on Feb 24, 2026

    @Mte90

    I have the same issue.
    I was thinking to create something like an alias for this cases but in opencode it isn't possible to implement something like that.

    I see that PR implement something like that with a normalization.

  4. phanthaitrung commented on Mar 15, 2026

    @phanthaitrung

    When entering this prompt, the LLM does an infinitive calls to the tool, causing loop call to AI api

    execute the tool ls, then tell me the result here

    Image
  5. removed
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  6. github-actions commented on Jul 4, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

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