优化系统提示词:移除冗余的工具列表,自动创建skills目录

- 移除 ToolsSection:工具定义已通过 API 的 tools 参数传递,无需在提示词中重复
- SkillsLoader 启动时自动创建 ~/.picobot/skills 目录
This commit is contained in:
xiaoxixi 2026-04-28 20:41:36 +08:00
parent 6c50f433d1
commit 8219e7c928
2 changed files with 9 additions and 1 deletions

View File

@ -39,7 +39,6 @@ impl SystemPromptBuilder {
sections: vec![ sections: vec![
Box::new(ToolHonestySection), Box::new(ToolHonestySection),
Box::new(NoToolNarrationSection), Box::new(NoToolNarrationSection),
Box::new(ToolsSection),
Box::new(YourTaskSection), Box::new(YourTaskSection),
Box::new(SafetySection), Box::new(SafetySection),
Box::new(WorkspaceSection), Box::new(WorkspaceSection),

View File

@ -70,6 +70,15 @@ impl SkillsLoader {
let mut state = self.state.lock().unwrap(); let mut state = self.state.lock().unwrap();
state.loaded_skills.clear(); 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 // Load from ~/.picobot/skills
if self.picobot_skills_dir.exists() { if self.picobot_skills_dir.exists() {
let loaded = self.load_skills_from_dir(&self.picobot_skills_dir); let loaded = self.load_skills_from_dir(&self.picobot_skills_dir);