Skip to content

fix: 系统注入的 boot / auto-recall prompt 和 NO_REPLY 会被写进记忆库 #1298

@Morganwan90

Description

@Morganwan90

Pre-submission checklist | 提交前检查

  • I have searched existing issues and this hasn't been mentioned before | 我已搜索现有问题,确认此问题尚未被提及
  • I have read the project documentation and confirmed this issue doesn't already exist | 我已阅读项目文档并确认此问题尚未存在
  • This issue is specific to MemOS and not a general software issue | 该问题是针对 MemOS 的,而不是一般软件问题

Bug Description | 问题描述

MemOS 在 agent_end 自动写入记忆时,会把部分运行时注入内容当作普通对话一起写进记忆库。

我本地实际遇到过这些内容被写入:

  • boot-check prompt
  • auto-recall 注入提示
  • NO_REPLY
  • HEARTBEAT_OK

例如会出现这类内容:

  • ## Memory system — ACTION REQUIRED
  • You are running a boot check. Follow BOOT.md instructions exactly.
  • Read HEARTBEAT.md if it exists. Follow it strictly.
  • NO_REPLY
  • HEARTBEAT_OK

看代码后感觉现在的 capture 逻辑主要是“黑名单式过滤”,已经过滤了一部分旧格式注入内容,但没有完整覆盖 boot / heartbeat / 新版 auto-recall prompt / sentinel reply,所以这些内容仍然可能进入长期记忆。
问题看起来出在 before_agent_start 注入的内容和 agent_end 捕获的新增消息之间,没有做足够严格的隔离。

这会污染 Memory Viewer,也会影响后续 recall / search 的质量。

How to Reproduce | 如何重现

  1. 安装并启用 @memtensor/memos-local-openclaw-plugin
  2. 配置 BOOT.mdHEARTBEAT.md
  3. 让 gateway 启动或 heartbeat 运行
  4. 让 MemOS 正常执行 auto-recall / auto-capture
  5. 打开 Memory Viewer 或查看 memos.db
  6. 可以看到部分运行时注入 prompt 或 sentinel reply 被写进记忆库

Environment | 环境信息

  • OpenClaw 2026.3.13
  • @memtensor/memos-local-openclaw-plugin 1.0.3
  • macOS

Additional Context | 其他信息

No response

Willingness to Implement | 实现意愿

  • I'm willing to implement this myself | 我愿意自己解决
  • I would like someone else to implement this | 我希望其他人来解决

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingpendingPending items to be addressed | 待解决事项。

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions