From 7bc17cc072b2c06b693e7f63f7516fcda2ecdcd2 Mon Sep 17 00:00:00 2001 From: Patrick Buckley Date: Mon, 16 Mar 2026 19:33:16 -0700 Subject: [PATCH] fix: populate func_args for all tools in intent judge evaluation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The heuristic engine was seeing empty {} for web_fetch, web_search, watch, notify, task, and load_skill — only bash, file ops, and MCP tools had their arguments forwarded. The judge could not pattern-match on URLs, queries, commands, or messages for these tools. --- turnstone/core/session.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/turnstone/core/session.py b/turnstone/core/session.py index 9afa82f2..6ff6a14f 100644 --- a/turnstone/core/session.py +++ b/turnstone/core/session.py @@ -1873,9 +1873,24 @@ class ChatSession: it["func_args"] = {"command": it.get("command", "")} elif name in ("write_file", "edit_file", "read_file"): it["func_args"] = {"path": it.get("path", "")} + elif name == "web_fetch": + it["func_args"] = {"url": it.get("url", ""), "question": it.get("question", "")} + elif name == "web_search": + it["func_args"] = {"query": it.get("query", ""), "topic": it.get("topic", "")} + elif name == "load_skill": + it["func_args"] = {"action": it.get("action", ""), "name": it.get("name", "")} + elif name == "watch": + it["func_args"] = { + "action": it.get("action", ""), + "command": it.get("command", ""), + "name": it.get("watch_name", ""), + } + elif name == "notify": + it["func_args"] = {"message": it.get("message", "")[:200]} + elif name == "task": + it["func_args"] = {"prompt": it.get("prompt", "")[:200]} elif it.get("mcp_args"): it["func_args"] = it["mcp_args"] - # Other tools: func_args stays absent → judge defaults to {} def _on_verdict(verdict: object) -> None: """Callback from the daemon judge thread."""