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

@ -32,7 +32,7 @@ TrulyMEM-TrueHumanMEM/
│ ├── services/ # Service layer (config only)
│ ├── handlers/ # Event handlers
│ └── styles/ # Style files
└── tests/ # Tests (42 tests)
└── tests/ # Tests (54 tests)
```
## Architecture Diagram
@ -146,13 +146,14 @@ def main():
## Tool System
### Memory Tools (6)
### Memory Tools (7)
- `memory_recall` - Retrieve memory
- `memory_commit` - Write memory
- `memory_purge` - Delete memory
- `memory_introspect` - View status
- `memory_archive` - Archive memory
- `memory_cleanup` - Clean data
- `context_rewrite` - Compress single-turn tool call context (experimental)
### Persona Tools (2)
- `persona_update` - Update persona
@ -166,6 +167,19 @@ def main():
---
## Tool Call Limits
| Category | Operation | Per-Turn Limit |
|----------|-----------|---------------|
| Persona graph | Modify | 1 time |
| Working memory chain | Modify | 5 times |
| General memory | Query | 20 times |
| General memory | Modify | 10 times |
> Note: `memory_recall` is uniformly counted as general memory query, no longer distinguished by persona/working memory queries.
---
## Error Handling Principle
All APIs **do not throw exceptions**, errors are passed via return dictionary: