fix: always offer controlBrowser in screen-share so on-screen search works

The small router reflexively routed every "search/open" intent to webSearch
and never surfaced controlBrowser, so "네이버에서 X 검색해줘" did nothing on the
broadcast. Union controlBrowser (+browseAndPlay) into the allow-list every
turn in screen-share mode (like setBroadcast), and steer the model in the
system prompt to prefer the on-screen browser over webSearch when available.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
javis-bot
2026-06-14 02:55:33 +09:00
parent c21c5b225f
commit f3d34bab4d
2 changed files with 14 additions and 0 deletions

View File

@@ -1036,6 +1036,16 @@ def run_reply_engine(db: "Database", cfg, tts: Optional[Any],
and "setBroadcast" not in routed_tools:
routed_tools = routed_tools + ["setBroadcast"]
# In screen-share mode, always offer the on-screen browser control too. The
# small router reflexively picks webSearch for any "search/open/find" intent
# and never surfaces controlBrowser, so the model never gets the option to
# actually drive the visible browser (e.g. "네이버에서 X 검색해줘"). Offer it
# every turn; it self-gates (no-op when nothing is asked of the browser).
if getattr(cfg, "stream_browser", True):
for _bt in ("controlBrowser", "browseAndPlay"):
if _bt in _full_catalog_names and _bt not in routed_tools:
routed_tools = routed_tools + [_bt]
_planner_schema = generate_tools_json_schema(routed_tools, mcp_tools)
_planner_tool_catalog: list[tuple[str, str]] = []
for _schema in (_planner_schema or []):