From 8219e7c928ba6945b47c9ba06bd949e83dcad01e Mon Sep 17 00:00:00 2001 From: xiaoxixi Date: Tue, 28 Apr 2026 20:41:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=B3=BB=E7=BB=9F=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E8=AF=8D=EF=BC=9A=E7=A7=BB=E9=99=A4=E5=86=97=E4=BD=99?= =?UTF-8?q?=E7=9A=84=E5=B7=A5=E5=85=B7=E5=88=97=E8=A1=A8=EF=BC=8C=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E5=88=9B=E5=BB=BAskills=E7=9B=AE=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除 ToolsSection:工具定义已通过 API 的 tools 参数传递,无需在提示词中重复 - SkillsLoader 启动时自动创建 ~/.picobot/skills 目录 --- src/agent/system_prompt.rs | 1 - src/skills/mod.rs | 9 +++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/agent/system_prompt.rs b/src/agent/system_prompt.rs index b2575bf..97403ce 100644 --- a/src/agent/system_prompt.rs +++ b/src/agent/system_prompt.rs @@ -39,7 +39,6 @@ impl SystemPromptBuilder { sections: vec![ Box::new(ToolHonestySection), Box::new(NoToolNarrationSection), - Box::new(ToolsSection), Box::new(YourTaskSection), Box::new(SafetySection), Box::new(WorkspaceSection), diff --git a/src/skills/mod.rs b/src/skills/mod.rs index c4030be..193580e 100644 --- a/src/skills/mod.rs +++ b/src/skills/mod.rs @@ -70,6 +70,15 @@ impl SkillsLoader { let mut state = self.state.lock().unwrap(); state.loaded_skills.clear(); + // Ensure ~/.picobot/skills directory exists + if !self.picobot_skills_dir.exists() { + if let Err(e) = std::fs::create_dir_all(&self.picobot_skills_dir) { + tracing::warn!(dir = %self.picobot_skills_dir.display(), error = %e, "Failed to create skills directory"); + } else { + tracing::info!(dir = %self.picobot_skills_dir.display(), "Created skills directory"); + } + } + // Load from ~/.picobot/skills if self.picobot_skills_dir.exists() { let loaded = self.load_skills_from_dir(&self.picobot_skills_dir);