gemini-cli - ✅(Solved) Fix feat(core): implement tool name hallucination repair in scheduler [1 pull requests, 2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
google-gemini/gemini-cli#26156Fetched 2026-04-30 06:45:15
View on GitHub
Comments
2
Participants
2
Timeline
10
Reactions
0
Author
Timeline (top)
referenced ×4commented ×2cross-referenced ×1labeled ×1

Fix Action

Fixed

PR fix notes

PR #26158: feat(core): implement tool repair

Description (problem / solution / changelog)

Fixes #26156

Changed files

  • packages/core/src/scheduler/scheduler.test.ts (modified, +241/-0)
  • packages/core/src/scheduler/scheduler.ts (modified, +83/-7)
  • packages/core/src/utils/fuzzy-matcher.test.ts (added, +83/-0)
  • packages/core/src/utils/fuzzy-matcher.ts (added, +85/-0)
  • packages/core/src/utils/tool-utils.ts (modified, +17/-4)
RAW_BUFFERClick to expand / collapse

The scheduler should automatically repair slightly misspelled or incorrectly formatted tool names from the model using fuzzy matching and normalization (e.g., kebab-case to snake_case).

extent analysis

TL;DR

Implement fuzzy matching and normalization to automatically repair slightly misspelled or incorrectly formatted tool names in the scheduler.

Guidance

  • Review the existing scheduler code to identify where tool names are processed and consider integrating a fuzzy matching library to handle slight misspellings.
  • Implement a normalization function to convert tool names from kebab-case to snake_case, ensuring consistency in tool name formatting.
  • Verify that the fuzzy matching and normalization logic correctly handles edge cases, such as tool names with special characters or varying capitalization.
  • Consider adding logging or monitoring to track instances where the scheduler repairs tool names, helping to identify potential issues or areas for improvement.

Example

import re

def normalize_tool_name(tool_name):
    # Convert kebab-case to snake_case
    return re.sub('-+', '_', tool_name)

def fuzzy_match_tool_name(input_name, known_tools):
    # Simple fuzzy matching example, consider using a dedicated library
    for tool in known_tools:
        if input_name.lower() == tool.lower():
            return tool
    return None

Notes

The effectiveness of the fuzzy matching and normalization approach may depend on the specific requirements and constraints of the scheduler and the model used.

Recommendation

Apply workaround: Implementing fuzzy matching and normalization as described can help address the issue of slightly misspelled or incorrectly formatted tool names, improving the scheduler's robustness.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING