Auto-sync: 2026-04-21 17:12
This commit is contained in:
@@ -1,29 +0,0 @@
|
||||
---
|
||||
title: "交接协议"
|
||||
type: concept
|
||||
tags: [ai-agent, memory, model-switching]
|
||||
last_updated: 2026-04-02
|
||||
---
|
||||
|
||||
## Definition
|
||||
在模型切换或会话结束前,将当前上下文写入每日日志的规范,确保新模型或新会话知道之前发生了什么。
|
||||
|
||||
## Problem
|
||||
OpenClaw 代理在切换模型时丢失所有上下文。新模型以新鲜上下文窗口开始——它只看到自动加载的文件。没有交接协议,新模型不知道发生了什么。
|
||||
|
||||
## Solution
|
||||
添加交接协议:在任何模型切换或会话结束前,代理将当前上下文写入每日日志。
|
||||
|
||||
## Implementation
|
||||
在 AGENTS.md 中添加写入纪律:
|
||||
- 每个任务记录其结果
|
||||
- 每个错误变成规则
|
||||
- 在模型切换前将当前状态转储到每日日志
|
||||
|
||||
## Key Insight
|
||||
> "写入纪律比读取纪律更重要。如果代理不将决定、结果和错误记录到磁盘,这些东西只存在于上下文窗口中。而上下文窗口会被压缩。"
|
||||
|
||||
## Related
|
||||
- [[上下文压缩]] — 导致信息丢失的机制
|
||||
- [[内存刷新]] — 在压缩前将重要内容写入磁盘
|
||||
- [[模型切换]] — OpenClaw 切换模型时的上下文丢失问题
|
||||
Reference in New Issue
Block a user