Fix explicit web intent initialization
All checks were successful
Container Image / build-and-push (push) Successful in 22s
All checks were successful
Container Image / build-and-push (push) Successful in 22s
This commit is contained in:
@@ -596,6 +596,7 @@ def setup_chat_routes(
|
|||||||
# shell disabled).
|
# shell disabled).
|
||||||
auto_escalated = False
|
auto_escalated = False
|
||||||
_tool_intent = _classify_tool_intent(message) if isinstance(message, str) else None
|
_tool_intent = _classify_tool_intent(message) if isinstance(message, str) else None
|
||||||
|
_explicit_web_intent = bool(_tool_intent and _tool_intent.category == "web")
|
||||||
if chat_mode == "chat" and _tool_intent and _tool_intent.needs_tools:
|
if chat_mode == "chat" and _tool_intent and _tool_intent.needs_tools:
|
||||||
chat_mode = "agent"
|
chat_mode = "agent"
|
||||||
auto_escalated = True
|
auto_escalated = True
|
||||||
@@ -882,11 +883,10 @@ def setup_chat_routes(
|
|||||||
):
|
):
|
||||||
disabled_tools.add("web_search")
|
disabled_tools.add("web_search")
|
||||||
disabled_tools.add("web_fetch")
|
disabled_tools.add("web_fetch")
|
||||||
if _explicit_web_intent:
|
if _explicit_web_intent and "web_search" not in disabled_tools:
|
||||||
# A direct lookup/search request should not drift into personal
|
# A direct lookup/search request should not drift into personal
|
||||||
# tools or shell fallbacks. We still keep web_search/web_fetch
|
# tools or shell fallbacks. If the caller explicitly disabled web
|
||||||
# available even when the frontend toggle is stale/falsy because
|
# search above, keep that hard deny.
|
||||||
# the user's words are the stronger signal.
|
|
||||||
disabled_tools.update({
|
disabled_tools.update({
|
||||||
"bash", "python",
|
"bash", "python",
|
||||||
"search_chats", "manage_skills", "manage_memory",
|
"search_chats", "manage_skills", "manage_memory",
|
||||||
@@ -1410,7 +1410,7 @@ def setup_chat_routes(
|
|||||||
_max_rounds = max(1, min(_max_rounds, 200))
|
_max_rounds = max(1, min(_max_rounds, 200))
|
||||||
|
|
||||||
_forced_tools = None
|
_forced_tools = None
|
||||||
if _explicit_web_intent:
|
if _explicit_web_intent and "web_search" not in disabled_tools:
|
||||||
_forced_tools = {"web_search", "web_fetch"}
|
_forced_tools = {"web_search", "web_fetch"}
|
||||||
elif _search_enabled:
|
elif _search_enabled:
|
||||||
_forced_tools = {"web_search", "web_fetch"}
|
_forced_tools = {"web_search", "web_fetch"}
|
||||||
|
|||||||
Reference in New Issue
Block a user