From 2d8177035b6a1dd3e9211c6cb5ba68443b826504 Mon Sep 17 00:00:00 2001 From: Steve Holloway Date: Wed, 8 Jul 2026 18:14:43 +0100 Subject: [PATCH] fix(chat): restore missing _explicit_web_intent definition (#5290) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit chat_stream() references `_explicit_web_intent` in three places (disabled-tools gating, global-disabled web allowance, and the per-turn tool filter) but the assignment was dropped during a branch merge. Every chat request raised NameError: name '_explicit_web_intent' is not defined at routes/chat_routes.py, surfacing to the client as a bare "Internal Server Error" before any LLM call was made — chat was fully broken on dev and main. Restore the original definition, computed from the already-derived tool intent, immediately before its first use: _explicit_web_intent = bool(_tool_intent and _tool_intent.category == "web") Co-authored-by: Claude Opus 4.8 (1M context) --- routes/chat_routes.py | 1 + 1 file changed, 1 insertion(+) diff --git a/routes/chat_routes.py b/routes/chat_routes.py index 705fa4ba9..848b36dbb 100644 --- a/routes/chat_routes.py +++ b/routes/chat_routes.py @@ -876,6 +876,7 @@ def setup_chat_routes( # by default without having to send allow_bash in every request. if allow_bash is not None and str(allow_bash).lower() != "true": disabled_tools.add("bash") + _explicit_web_intent = bool(_tool_intent and _tool_intent.category == "web") if ( allow_web_search is not None and str(allow_web_search).lower() != "true"