hermes - ✅(Solved) Fix [Bug]: Tool dispatch fails with "Unknown tool" for CamelCase/_tool-suffix model emissions [1 pull requests, 1 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
NousResearch/hermes-agent#14784Fetched 2026-04-24 06:14:41
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Timeline (top)
labeled ×3commented ×1cross-referenced ×1

Fix Action

Fix / Workaround

Claude models intermittently emit tool names like TodoTool_tool, Patch_tool, and BrowserClick_tool. These are trivially normalizable (strip _tool suffix, convert CamelCase to snake_case) but currently return "Unknown tool" errors, causing unnecessary retries and wasted tokens.

PR fix notes

PR #14786: fix(tools): add fallback normalization for CamelCase/_tool-suffix drift in tool dispatch

Description (problem / solution / changelog)

What does this PR do?

Adds _normalize_tool_name() helper that strips _tool suffixes and converts CamelCase to snake_case before tool registry lookup. Claude models intermittently emit names like TodoTool_tool or Patch_tool — trivially normalizable but previously returned "Unknown tool" errors.

Related Issue

Fixes #14784

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)

Changes Made

  • tools/registry.py: Added _normalize_tool_name() fallback normalization
  • tests/tools/test_tool_name_normalize.py: 16 tests

How to Test

python -m pytest -o 'addopts=' tests/tools/test_tool_name_normalize.py -v

Result: 16 passed.

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits
  • I searched for existing PRs
  • My PR contains only changes related to this fix
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes
  • I've tested on my platform: macOS 15 (Darwin 24.6.0), Python 3.14.2

Documentation & Housekeeping

  • N/A for all documentation items

Changed files

  • tests/tools/test_tool_name_normalize.py (added, +154/-0)
  • tools/registry.py (modified, +53/-1)
RAW_BUFFERClick to expand / collapse

Describe the bug

Claude models intermittently emit tool names like TodoTool_tool, Patch_tool, and BrowserClick_tool. These are trivially normalizable (strip _tool suffix, convert CamelCase to snake_case) but currently return "Unknown tool" errors, causing unnecessary retries and wasted tokens.

Steps to reproduce

  1. Use a model that occasionally emits tool names with CamelCase or _tool suffixes
  2. Observe "Unknown tool" errors in the agent loop despite the tool existing

Expected behavior

The tool registry should normalize tool names before lookup — stripping _tool suffixes and converting CamelCase to snake_case as a fallback before reporting "Unknown tool."

Environment

  • Hermes Agent version: current main
  • OS: any

extent analysis

TL;DR

Implementing a normalization step for tool names in the tool registry to handle CamelCase and _tool suffixes can likely resolve the "Unknown tool" errors.

Guidance

  • Verify the tool registry's current handling of tool names to confirm the lack of normalization.
  • Consider adding a preprocessing step to strip _tool suffixes and convert CamelCase to snake_case before looking up tools.
  • Review the agent loop's error handling to ensure it can gracefully handle normalized tool names.
  • Test the normalization approach with various tool name formats to ensure compatibility.

Example

def normalize_tool_name(tool_name):
    # Strip _tool suffix
    tool_name = tool_name.removesuffix("_tool")
    # Convert CamelCase to snake_case
    tool_name = "".join(["_" + i.lower() if i.isupper() else i for i in tool_name]).lstrip("_")
    return tool_name

Notes

The provided solution assumes that the tool registry has a programmable interface for adding custom normalization logic. If this is not the case, alternative approaches may be necessary.

Recommendation

Apply a workaround by implementing a normalization function, like the one provided, to preprocess tool names before lookup, as the issue seems to stem from a missing feature rather than a version-specific bug.

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…

FAQ

Expected behavior

The tool registry should normalize tool names before lookup — stripping _tool suffixes and converting CamelCase to snake_case as a fallback before reporting "Unknown tool."

Still need to ship something?

×6

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

Back to top recommendations

TRENDING

hermes - ✅(Solved) Fix [Bug]: Tool dispatch fails with "Unknown tool" for CamelCase/_tool-suffix model emissions [1 pull requests, 1 comments, 2 participants]