fix(agent): honor explicit web search requests

Promote explicit web-search phrasing to tool use and keep web_search/web_fetch available for that turn even when the stale web toggle is false.
This commit is contained in:
Dividesbyzer0
2026-06-15 02:02:10 -04:00
committed by GitHub
parent a7766d0b7f
commit a07fe35936
7 changed files with 51 additions and 4 deletions
+6 -1
View File
@@ -696,7 +696,12 @@ 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")
if allow_web_search is not None and str(allow_web_search).lower() != "true":
_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"
and not _explicit_web_intent
):
disabled_tools.add("web_search")
disabled_tools.add("web_fetch")