From 642fa42561fc1e519f12079e4076853e91f50ac7 Mon Sep 17 00:00:00 2001 From: javis-bot Date: Sun, 14 Jun 2026 02:57:51 +0900 Subject: [PATCH] fix: drop webSearch when a site is named in screen-share, forcing controlBrowser MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The 3B model kept choosing webSearch over controlBrowser even when offered, so '네이버에서 X 검색' still used the invisible web path. When broadcasting and the user explicitly names a site, remove webSearch from the allow-list so the on-screen browser is the only search route. Co-Authored-By: Claude Opus 4.7 --- src/jarvis/reply/engine.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/jarvis/reply/engine.py b/src/jarvis/reply/engine.py index 2200635..7473dfe 100644 --- a/src/jarvis/reply/engine.py +++ b/src/jarvis/reply/engine.py @@ -1045,6 +1045,19 @@ def run_reply_engine(db: "Database", cfg, tts: Optional[Any], for _bt in ("controlBrowser", "browseAndPlay"): if _bt in _full_catalog_names and _bt not in routed_tools: routed_tools = routed_tools + [_bt] + # When the user explicitly names a website (a proper noun, not a language + # pattern), the on-screen browser is unambiguously what they want — but + # the small router reflexively keeps webSearch and the model picks the + # invisible web path. Drop webSearch for that turn so controlBrowser + # wins. Only fires when a site is named AND we're in screen-share mode. + _site_tokens = ( + "naver", "네이버", "google", "구글", "daum", "다음", + "youtube", "유튜브", "유투브", "bing", + ) + if "controlBrowser" in routed_tools and "webSearch" in routed_tools \ + and any(_tok in redacted.lower() for _tok in _site_tokens): + routed_tools = [t for t in routed_tools if t != "webSearch"] + debug_log("screen-share: site named — dropping webSearch so controlBrowser wins", "tools") _planner_schema = generate_tools_json_schema(routed_tools, mcp_tools) _planner_tool_catalog: list[tuple[str, str]] = []