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]] = []