feat(gui): expand AGENT_TOOL_NAMES to all 26 MCP tools with mutating tools grouped
This commit is contained in:
10
gui_2.py
10
gui_2.py
@@ -79,7 +79,15 @@ KIND_COLORS: dict[str, tuple[float, ...]] = {"request": C_REQ, "response": C_RES
|
|||||||
HEAVY_KEYS: set[str] = {"message", "text", "script", "output", "content"}
|
HEAVY_KEYS: set[str] = {"message", "text", "script", "output", "content"}
|
||||||
|
|
||||||
DISC_ROLES: list[str] = ["User", "AI", "Vendor API", "System"]
|
DISC_ROLES: list[str] = ["User", "AI", "Vendor API", "System"]
|
||||||
AGENT_TOOL_NAMES: list[str] = ["run_powershell", "read_file", "list_directory", "search_files", "get_file_summary", "web_search", "fetch_url"]
|
AGENT_TOOL_NAMES: list[str] = [
|
||||||
|
"run_powershell", "read_file", "list_directory", "search_files", "get_file_summary",
|
||||||
|
"web_search", "fetch_url", "py_get_skeleton", "py_get_code_outline", "get_file_slice",
|
||||||
|
"py_get_definition", "py_get_signature", "py_get_class_summary", "py_get_var_declaration",
|
||||||
|
"get_git_diff", "py_find_usages", "py_get_imports", "py_check_syntax", "py_get_hierarchy",
|
||||||
|
"py_get_docstring", "get_tree", "get_ui_performance",
|
||||||
|
# Mutating tools — disabled by default
|
||||||
|
"set_file_slice", "py_update_definition", "py_set_signature", "py_set_var_declaration",
|
||||||
|
]
|
||||||
|
|
||||||
def truncate_entries(entries: list[dict[str, Any]], max_pairs: int) -> list[dict[str, Any]]:
|
def truncate_entries(entries: list[dict[str, Any]], max_pairs: int) -> list[dict[str, Any]]:
|
||||||
if max_pairs <= 0:
|
if max_pairs <= 0:
|
||||||
|
|||||||
@@ -55,3 +55,15 @@ def test_default_project_mutating_tools_disabled():
|
|||||||
for tool in MUTATING_TOOLS:
|
for tool in MUTATING_TOOLS:
|
||||||
assert tool in tools, f"{tool} missing from default_project"
|
assert tool in tools, f"{tool} missing from default_project"
|
||||||
assert tools[tool] is False, f"Mutating tool '{tool}' should default to False"
|
assert tools[tool] is False, f"Mutating tool '{tool}' should default to False"
|
||||||
|
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------------------
|
||||||
|
# Task 2.2: AGENT_TOOL_NAMES in gui_2.py exposes all dispatch tools
|
||||||
|
# ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
def test_gui_agent_tool_names_exposes_all_dispatch_tools():
|
||||||
|
"""AGENT_TOOL_NAMES in gui_2.py must include every tool in mcp_client.dispatch()."""
|
||||||
|
from gui_2 import AGENT_TOOL_NAMES
|
||||||
|
gui_tools = set(AGENT_TOOL_NAMES)
|
||||||
|
missing = ALL_DISPATCH_TOOLS - gui_tools
|
||||||
|
assert not missing, f"Tools missing from gui_2.AGENT_TOOL_NAMES: {missing}"
|
||||||
|
|||||||
Reference in New Issue
Block a user