feat(mcp_client): add MUTATING_TOOLS frozenset sentinel for HITL enforcement

This commit is contained in:
2026-03-02 16:47:51 -05:00
parent 2d8f9f4d7a
commit 1f92629a55
2 changed files with 37 additions and 0 deletions

View File

@@ -40,6 +40,17 @@ import urllib.parse
from html.parser import HTMLParser
import re as _re
# ------------------------------------------------------------------ mutating tools sentinel
# Tools that write or modify files. ai_client checks this set before dispatch
# and routes to pre_tool_callback (GUI approval) if the tool name is present.
MUTATING_TOOLS: frozenset[str] = frozenset({
"set_file_slice",
"py_update_definition",
"py_set_signature",
"py_set_var_declaration",
})
# ------------------------------------------------------------------ state
# Set by configure() before the AI send loop starts.