From cd3f7b5c72327d55d3c6a1f0620cae28058e4813 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 16:06:53 +0800 Subject: [PATCH] A bot that is unsure which computer the person means asks first instead of picking one --- src/app.rs | 1 + src/tools.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app.rs b/src/app.rs index a1f0c33..6c48ab5 100644 --- a/src/app.rs +++ b/src/app.rs @@ -3773,6 +3773,7 @@ fn system_prompt(b: &Bot, st: &State, computers: &[tools::Target], default_compu s.push_str(&format!( "\n\n你可以用工具在電腦上做事。每個工具都有 computer 參數,預設是「{default_computer}」。\n{}\n\ - 使用者替你選的電腦是「{default_computer}」:檔案、指令、看畫面、點擊和瀏覽器都在這台做,不要自己換到別台。只有使用者在訊息裡指名另一台(「在我的 Mac 上」「在 Bot 的電腦上」),才把 computer 設成那台。\n\ + - 不確定使用者指的是哪台電腦時(例如他說「我的電腦」而那台不在清單上、有幾台都說得通、或他的說法和你手上的預設不一致),先用一句話問他要哪台,問清楚再動手;不要擅作主張選一台就開始做,也不要把一台說成另一台。\n\ - 先用 list_dir、search、read_file 看清楚,再動手。\n\ - 需要權限時(電腦工具還沒打開、要用使用者的電腦、會改變東西的操作),直接呼叫工具,App 會自己跳出視窗請使用者允許;不要叫使用者自己去改設定。被拒絕就換個方式或問使用者。\n\ - 跑很久的指令會移到背景,用 read_terminal 追蹤,不要重複執行;它在等輸入時(例如問 y/n),用 write_terminal 回答。\n\ diff --git a/src/tools.rs b/src/tools.rs index 041fc69..24c3feb 100644 --- a/src/tools.rs +++ b/src/tools.rs @@ -635,7 +635,7 @@ pub fn specs_for(computers: &[String], default: &str) -> Vec { let desc = if computers.iter().any(|c| c == crate::model::THIS_COMPUTER_NAME) { format!("Which computer to work on. Default: {default}. Use the one the person names (\"在我的 Mac 上\" = {}).", crate::model::THIS_COMPUTER_NAME) } else { - format!("Which computer to work on. Default: {default}. None of these is the person's own computer (it is not connected): use the default, and when the person means their own computer, tell them it is not connected (App › 設定 › 電腦) instead of working on another machine and calling it theirs.") + format!("Which computer to work on. Default: {default}. None of these is the person's own computer (it is not connected): when the person means their own computer, ask which computer they want and tell them theirs is not connected (App › 設定 › 電腦) — never work on another machine and call it theirs.") }; t["parameters"]["properties"]["computer"] = json!({ "type": "string",