From 2a78c58828a45ab633e456041935da5848b72afa Mon Sep 17 00:00:00 2001 From: 0xallam Date: Sat, 25 Apr 2026 16:29:51 -0700 Subject: [PATCH] refactor(agents-graph): drop redundant ``agent_finish_called`` set ``agent_finish`` was setting ``inner[\"agent_finish_called\"] = True`` at the top of its body, but ``StrixOrchestrationHooks.on_tool_end`` already does this for ``agent_finish`` and ``finish_scan`` after the tool returns. Doing it twice was harmless but suggested the flag's ownership was ambiguous; the hook is the single source of truth. --- strix/tools/agents_graph/tools.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/strix/tools/agents_graph/tools.py b/strix/tools/agents_graph/tools.py index 03b21cae..a71cfa05 100644 --- a/strix/tools/agents_graph/tools.py +++ b/strix/tools/agents_graph/tools.py @@ -557,7 +557,8 @@ async def agent_finish( default=str, ) - inner["agent_finish_called"] = True + # ``agent_finish_called`` is set by ``StrixOrchestrationHooks.on_tool_end``; + # no need to set it here. parent_notified = False if report_to_parent: