From cd7a4207cc28b874765b95898903f780adca8ee1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=80=A7=E9=A9=8A?= Date: Thu, 5 Nov 2026 08:17:07 +0800 Subject: [PATCH] Browser tools on a brain without a browser go to its hands MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A brain on a server has no AnyBot browser, and browser_open/read were sent to it even when the bot named a 手腳 computer. Now a named computer wins, and with none named the hands' browser is used. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Uirha3oEtWeHh58zA7ErHa --- src/agent.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/agent.rs b/src/agent.rs index 8db8928..876cf40 100644 --- a/src/agent.rs +++ b/src/agent.rs @@ -627,6 +627,12 @@ pub fn spawn(job: Job, bot_id: u64, tx: Sender<(u64, StreamEvent)>, cancel: Arc< // …and so does screen control: it's the person's own screen. let target = if is_screen { screen_target(&job, &call.args) + } else if is_web && device_named(&job, &call.args).is_some() { + // The browser on another computer of the account, as named. + target_for(&job, &call.args) + } else if is_web && call.name.starts_with("browser_") && !crate::botbrowser::available() && job.computers.iter().any(|t| matches!(t.place, tools::Place::Device { .. })) { + // No browser here (a brain on a server): the 手腳 computer's. + job.computers.iter().find(|t| matches!(t.place, tools::Place::Device { .. })).cloned().ok_or_else(|| "找不到這台電腦".to_string()) } else if is_mac || web::uses_this_computer(&call.name, &call.args) { job.computers.iter().find(|t| t.name == crate::model::THIS_COMPUTER_NAME).cloned().ok_or_else(|| "找不到這台電腦".to_string()) } else {