add Automatically compacted context

This commit is contained in:
lpf
2026-02-13 17:14:27 +08:00
parent ff27e05f71
commit f05664dcd0
5 changed files with 260 additions and 8 deletions

View File

@@ -156,6 +156,7 @@ Shell 工具默认启用 Risk Gate。检测到破坏性命令时默认阻断
- `memory_search`:增加结构化索引(倒排索引 + 缓存),优先走索引检索。
- 记忆分层:支持 `profile / project / procedures / recent notes`
- 自动上下文压缩Automatically Compacted Context会话过长时自动生成摘要并裁剪历史降低 token 开销与卡顿风险。
```json
"memory": {
@@ -169,6 +170,30 @@ Shell 工具默认启用 Risk Gate。检测到破坏性命令时默认阻断
}
```
上下文自动压缩配置:
```json
"agents": {
"defaults": {
"context_compaction": {
"enabled": true,
"trigger_messages": 60,
"keep_recent_messages": 20,
"max_summary_chars": 6000,
"max_transcript_chars": 20000
}
}
}
```
也可以热更新:
```bash
clawgo config set agents.defaults.context_compaction.enabled true
clawgo config set agents.defaults.context_compaction.trigger_messages 80
clawgo config set agents.defaults.context_compaction.keep_recent_messages 24
```
## 🗺️ Repo-Map 与原子技能
- `repo_map`:生成并查询代码全景地图,先定位目标文件再精读。