[Bug] Multi-Agent mode: cross-agent memory injection + recursive chunk duplication (65908 records in 1 week)
Pre-submission checklist | 提交前检查
- [x] I have searched existing issues and this hasn't been mentioned before | 我已搜索现有问题,确认此问题尚未被提及
- [x] I have read the project documentation and confirmed this issue doesn't already exist | 我已阅读项目文档并确认此问题尚未存在
- [x] This issue is specific to MemOS and not a general software issue | 该问题是针对 MemOS 的,而不是一般软件问题
Bug Description | 问题描述
Description:
Bug 1: 跨 Agent 私有记忆被错误召回注入
开启多 Agent 模式后,数据库 chunks 表的 owner 字段存储隔离正常(各 Agent 有独立 owner),但召回时未按当前 Agent 的 owner 过滤,导致其他 Agent 的私有记忆被注入到当前 Agent 的上下文中。
复现步骤:
- 开启
multiAgentMode: true - Agent A 和 Agent B 分别进行对话
- 与 Agent B 对话时,上下文中出现 Agent A 的私有记忆内容
验证:数据库查询确认存储隔离正常,问题出在召回逻辑层。
Bug 2: chunks 表循环写入导致数据库异常膨胀
使用插件一周后,chunks 表膨胀至 65,908 条记录,数据库体积达 320MB(db + wal)。
其中 "hi" 单条内容重复写入 54,603 次,其他内容也出现数十次重复震荡写入。
根本原因推测:召回注入的记忆内容被摘要器反复处理并写回,Dedup Judge 未能有效过滤,形成循环写入。
Bug 3: allowPromptInjection: false 配置不生效
在插件 config 中设置 allowPromptInjection: false 后,PromptInjection 依然在执行,配置项未被正确读取。
How to Reproduce | 如何重现
复现步骤:
- 开启
multiAgentMode: true - Agent A 和 Agent B 分别进行对话
- 与 Agent B 对话时,上下文中出现 Agent A 的私有记忆内容
Environment | 环境信息
Environment:
- openclaw 2026.3.28
- Plugin:
memos-local-openclaw-pluginv1.0.7 - Mode: Multi-Agent (
multiAgentMode: true) - Storage: SQLite
Additional Context | 其他信息
清理过程(供参考):
-- 去重
DELETE FROM chunks
WHERE rowid NOT IN (
SELECT MAX(rowid) FROM chunks
GROUP BY substr(content,1,200), owner
);
-- 重建 FTS 索引
INSERT INTO chunks_fts(chunks_fts) VALUES('rebuild');
INSERT INTO skills_fts(skills_fts) VALUES('rebuild');
-- WAL 合并
PRAGMA wal_checkpoint(TRUNCATE);
VACUUM;
清理后数据库从 320MB 压缩至 62MB。
期望修复:
- 召回时按当前 Agent 的 owner 过滤,确保多 Agent 记忆隔离
- 修复 Dedup Judge,防止相同内容循环写入
- 修复
allowPromptInjection配置项读取
Willingness to Implement | 实现意愿
- [ ] I'm willing to implement this myself | 我愿意自己解决
- [ ] I would like someone else to implement this | 我希望其他人来解决
Version 1.0.8 has fixed the issue of incorrect recall in multi-agent memory.
This issue has been automatically marked as stale due to inactivity.
This issue has been automatically closed due to inactivity.