清理废弃代码,重构长期记忆系统

核心变更:
- 删除 worker.rs + ipc.rs(废弃进程架构)
- 删除 ias listen 路径(cmd_listen / listen_loop / ToolExecutor)
- 合并 ias service → ias daemon --log-file
- 修复 main.rs call_capability 不处理上下文工具的 bug

MemoryStore 重构:
- write_for 空内容防御 + 精确去重
- 缓存结构 Vec<String> → Vec<(i32, String)>(用数据库 id 标识)
- 新增 delete_for / update_for 方法 + LLM 工具定义
- load_if_needed 避免每次消息查 DB
- 缓存 TTL(1h) + 每用户 200 条上限
- read_for limit 参数(默认 30 条)

daemon.rs:
- execute_tool 统一为递归派发,消除 call_capability 重复路由

净减少约 1400 行代码,0 warning,20 测试通过
This commit is contained in:
2026-06-16 11:56:36 +08:00
parent 5a54368437
commit 1d78567102
19 changed files with 1060 additions and 1895 deletions
+2
View File
@@ -904,6 +904,7 @@ fn urlencoding(s: &str) -> String {
// 统一分发入口
// ═══════════════════════════════════════════════
#[allow(dead_code)]
pub fn specs() -> Vec<SkillSpec> {
vec![
poi_search_spec(),
@@ -915,6 +916,7 @@ pub fn specs() -> Vec<SkillSpec> {
]
}
#[allow(dead_code)]
pub async fn execute(name: &str, params: serde_json::Value) -> Option<SkillResult> {
match name {
"amap_poi_search" => Some(poi_search_execute(params).await),