fix(docker+brain): make container Chrome search work, harden, improve toggle

Addresses review findings on the dockerized stack:
- Container Chrome search was dead: add --remote-debugging-port + a non-default
  --user-data-dir (Chrome 136+ refuses CDP on the default profile), add the
  playwright dep (browse-search.mjs connectOverCDP) with browser download
  skipped, and connect to 127.0.0.1 not "localhost" (container localhost -> ::1
  while Chrome binds IPv4). Verified: browse-search returns real results.
- Broadcast toggle reliability: always offer setBroadcast in screen-share mode
  (the embedding/keyword router dropped it for non-English utterances) and make
  its description force a tool call. "방송 꺼줘"->stop now 5/5; no false triggers.
- Stop the broadcast on voice leave (no orphaned stream).
- Security: bind VNC/noVNC to loopback by default (VNC_BIND override) and the
  bridge to the container loopback (BRIDGE_HOST=127.0.0.1), not published.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
javis-bot
2026-06-11 10:44:56 +09:00
parent ca86390407
commit 03375a77d0
10 changed files with 56 additions and 14 deletions

View File

@@ -975,6 +975,15 @@ def run_reply_engine(db: "Database", cfg, tts: Optional[Any],
"planning",
)
# In screen-share mode, always offer setBroadcast. "Turn the broadcast
# on/off" is language-agnostic intent the embedding/keyword router won't
# reliably surface for a non-English utterance (e.g. "방송 꺼줘"), so the
# model would otherwise never get the option. It self-gates and is only
# acted on when the model actually calls it.
if getattr(cfg, "stream_browser", True) and "setBroadcast" in _full_catalog_names \
and "setBroadcast" not in routed_tools:
routed_tools = routed_tools + ["setBroadcast"]
_planner_schema = generate_tools_json_schema(routed_tools, mcp_tools)
_planner_tool_catalog: list[tuple[str, str]] = []
for _schema in (_planner_schema or []):