From 7b4365fe57b9c172bc944ebafe3864149cb627f5 Mon Sep 17 00:00:00 2001 From: Kenny Van de Maele Date: Fri, 5 Jun 2026 00:02:14 +0200 Subject: [PATCH] Make write_file/edit_file always-available like read_file (#2684) read_file/grep/glob/ls are in ALWAYS_AVAILABLE but the on-disk write tools (write_file, edit_file) were only surfaced via per-query tool-RAG retrieval. On a bare 'edit X' request the retriever could miss them, so the model was never offered edit_file/write_file and wrongly fell back to edit_document (editor panel) or improvised with bash sed. Add both to ALWAYS_AVAILABLE next to read_file; they stay admin-gated by tool_security so non-admin exposure is unchanged. Fixes #2683 --- src/tool_index.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/tool_index.py b/src/tool_index.py index 3c277b9..e56ce9e 100644 --- a/src/tool_index.py +++ b/src/tool_index.py @@ -22,7 +22,12 @@ logger = logging.getLogger(__name__) # Tools that are ALWAYS included regardless of retrieval results. # These are the most commonly needed and should never be missing. ALWAYS_AVAILABLE = frozenset({ - "bash", "python", "web_search", "web_fetch", "read_file", + "bash", "python", "web_search", "web_fetch", + # File tools: read AND write/edit. An agent with disk access should always + # be able to change files, not just read them — otherwise a bare "edit X" + # request can miss write_file/edit_file (RAG-only) and the model wrongly + # falls back to edit_document (editor panel). All admin-gated by tool_security. + "read_file", "write_file", "edit_file", "grep", "glob", "ls", # code-navigation tools (admin-gated by tool_security) "api_call", # For configured integrations (Miniflux, Gitea, Linkding, etc.) # The two genuinely AMBIENT cookbook tools — "what's running" and