refactor: import FILE_MUTATING_TOOL_NAMES from shared module

Drops the duplicate _FILE_MUTATING_TOOLS frozenset in run_agent.py and
imports the canonical FILE_MUTATING_TOOL_NAMES from
agent/tool_result_classification.py (aliased as _FILE_MUTATING_TOOLS to
avoid renaming the existing call sites). Prevents future drift if
another file-mutating tool is added — only one set needs updating.

No behavior change: same frozenset({'write_file', 'patch'}), and the
117 PR-scoped tests still pass.
This commit is contained in:
kshitijk4poor 2026-05-13 18:59:03 +05:30 committed by kshitij
parent da0ddbf88a
commit c3094b46e9

View file

@ -181,7 +181,10 @@ from agent.tool_guardrails import (
append_toolguard_guidance, append_toolguard_guidance,
toolguard_synthetic_result, toolguard_synthetic_result,
) )
from agent.tool_result_classification import file_mutation_result_landed from agent.tool_result_classification import (
FILE_MUTATING_TOOL_NAMES as _FILE_MUTATING_TOOLS,
file_mutation_result_landed,
)
from agent.trajectory import ( from agent.trajectory import (
convert_scratchpad_to_think, has_incomplete_scratchpad, convert_scratchpad_to_think, has_incomplete_scratchpad,
save_trajectory as _save_trajectory_to_file, save_trajectory as _save_trajectory_to_file,
@ -350,7 +353,7 @@ _PATH_SCOPED_TOOLS = frozenset({"read_file", "write_file", "patch"})
# Tools that mutate files on disk. Used by the per-turn verifier that # Tools that mutate files on disk. Used by the per-turn verifier that
# surfaces silently-failed file edits so the model can't over-claim success. # surfaces silently-failed file edits so the model can't over-claim success.
_FILE_MUTATING_TOOLS = frozenset({"write_file", "patch"}) # Imported above as `_FILE_MUTATING_TOOLS` from `agent.tool_result_classification`.
# Maximum number of concurrent worker threads for parallel tool execution. # Maximum number of concurrent worker threads for parallel tool execution.
_MAX_TOOL_WORKERS = 8 _MAX_TOOL_WORKERS = 8