feat: 添加 context_rewrite 工具并清理工具限制器死配置

- 新增 context_rewrite 工具:允许 AI 在单轮内压缩工具调用上下文
- 清理 persona_query_max 和 task_query_max 死配置(commit 9be60ba 引入)
- 同步全栈:后端/前端/文档/测试 18 个文件
- 测试:70/70 通过
This commit is contained in:
root
2026-04-16 14:33:21 +08:00
parent 535fca933a
commit 2aa6e9240f
19 changed files with 431 additions and 129 deletions

View File

@ -25,6 +25,14 @@ TrulyMEM 的解决思路:
所有记忆必须通过以下方式读取:
- `memory_recall` - 检索记忆
### 工作记忆管理(实验性)
`context_rewrite` 允许 AI 在单轮对话内主动压缩工具调用的临时上下文:
- 将冗长的 JSON 工具结果提炼为简洁的自然语言摘要
- 摘要必须包含调用了哪些工具、对几次调用的总结
- 系统验证格式后,替换 `messages_history` 为 `[用户消息, 摘要]`
- 确保 LLM 保留元认知(知道"我调用过工具"),同时减少 JSON 噪音
---
## 强制执行流程(每轮对话)