fix: 修复 daemon 架构中 3 个 blocking 正确性 bug

1. call_capability 元工具不可用
   - execute_tool() 中缺失 call_capability 处理分支
   - 添加解包 {name, prompt} → 提取目标工具并派发的逻辑

2. tool_call_id 传空字符串
   - Tool Consumer 中 tool_call_id 被 _ 忽略,ToolResult 传空串
   - 改为使用 LLM 原始 tool_call_id 传递

3. 高风险工具审批无限循环
   - Tool Consumer 无条件触发审批,approved_tool 从未被读取
   - ToolCall 新增 approved 字段,已批准的工具跳过审批
   - ToolExecutor 根据 approved_tool 设置标记

4. Session TTL 时间戳不更新(should-fix)
   - ToolResult 回喂时更新 last_access,防止长对话被误清理

5. 其他清理
   - load_memories 魔数字符串比较改为 starts_with
   - _sock_path 添加文档说明保留用于兼容
   - MessageKind::ToolCall 新增 approved: bool 字段
This commit is contained in:
2026-06-09 22:10:39 +08:00
parent 8ed608f01b
commit 713cbb7cc3
5 changed files with 121 additions and 11 deletions
+16
View File
@@ -0,0 +1,16 @@
# CodeGraph data files
# These are local to each machine and should not be committed
# Database
*.db
*.db-wal
*.db-shm
# Cache
cache/
# Logs
*.log
# Hook markers
.dirty
+6
View File
@@ -0,0 +1,6 @@
{
"pid": 2145387,
"version": "0.9.9",
"socketPath": "/home/xiao/project/iAs/.codegraph/daemon.sock",
"startedAt": 1781008946109
}