From e870609842d13181126dc2d2527fb46ce2dedc6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BB=9D=E5=B0=98?= <237809796@qq.com> Date: Sun, 28 Jun 2026 17:12:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D:=20system=5Fprompt=20?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=E8=A1=8C=E4=B8=BA=E5=87=86=E5=88=99,?= =?UTF-8?q?=E5=87=8F=E5=B0=91=20LLM=20=E5=86=99=E8=84=9A=E6=9C=AC=E5=81=8F?= =?UTF-8?q?=E5=A5=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src-tauri/src/commands/ai/agentic/mod.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src-tauri/src/commands/ai/agentic/mod.rs b/src-tauri/src/commands/ai/agentic/mod.rs index 9b4db0b..6b2261d 100644 --- a/src-tauri/src/commands/ai/agentic/mod.rs +++ b/src-tauri/src/commands/ai/agentic/mod.rs @@ -830,7 +830,8 @@ pub(crate) async fn run_agentic_loop( // 输出平台一致性。detect() 是 OnceLock 全局缓存(启动时探一次,后续零开销),与 G1 一样 // 是 loop 不变量(整个会话不重探),与目标钉扎拼接次序无强约束(放其后,语义自然)。 let env_prompt = df_execute::EnvSnapshot::detect().await.to_prompt(); - system_prompt = format!("{}\n\n{}", system_prompt, env_prompt); + let behavior_prompt = "\n## 行为准则\n- 使用工具指令(create_project/write_file/grep/read_file/run_command 等)直接完成任务,不要让用户去终端执行命令\n- 优先使用开发工具 IPC,非必要不写独立脚本(write_file + run_command = 两次审批,拖慢工作流)\n- 已有 40+ 工具覆盖绝大多数场景,先查工具列表再决定"; + system_prompt = format!("{}\n\n{}\n\n{}", system_prompt, env_prompt, behavior_prompt); // 对话透明化 L1:拍快照供 AiCompleted 事件携带,前端直接读取 pinned_goals 无需等 loadConversations let pinned_goals_snapshot: Vec = {