normaliztion fix

This commit is contained in:
AuroraCrimsonRose
2026-06-03 06:16:01 -05:00
parent e471f9bc54
commit c61e4a268f
2 changed files with 22 additions and 1 deletions

20
core/tools/normalize.py Normal file
View File

@@ -0,0 +1,20 @@
# core/tools/normalize.py
from __future__ import annotations
def normalize_tool_name(name: str) -> str:
"""
Converts transport-layer tool names (Continue MCP)
into internal registry tool names.
"""
if not isinstance(name, str):
raise ValueError("tool name must be string")
name = name.strip()
# Continue MCP prefix stripping
if name.startswith("vs_code_mcp_"):
return name[len("vs_code_mcp_"):]
return name

View File

@@ -19,6 +19,7 @@ from core.executor import executor
from core.tools.registry import registry
from core.tools.base import ToolContext
from tools.discovery import load_all_tools
from core.tools.normalize import normalize_tool_name
# =========================
@@ -72,7 +73,7 @@ def bind_registry_tools() -> None:
try:
return registry.run(
name=bound_tool.name,
name=normalize_tool_name(bound_tool.name),
payload=kwargs,
ctx=ctx
)