Skip to content

MemOS 注入的 Prompt 触发 OpenClaw 心跳检测,导致消息被误判为心跳轮询 #40

@Greenplumwine

Description

@Greenplumwine

问题描述

当启用 memos-cloud-openclaw-plugin 插件时,所有用户消息都会被注入记忆上下文(包含 "Read HEARTBEAT.md if it exists..." 这段指令)。这导致 OpenClaw 的心跳检测机制误判消息为心跳轮询,助手只回复 HEARTBEAT_OK 而无法正常响应用户。

复现步骤

  1. 安装并启用 @memtensor/memos-cloud-openclaw-plugin@latest
  2. 发送任意消息(如 "你是谁")
  3. 助手回复 HEARTBEAT_OK,不执行实际任务

根本原因

OpenClaw 的心跳检测匹配了 MemOS 注入 Prompt 中的这段文字:
> "Read HEARTBEAT.md if it exists (workspace context). Follow it strictly. Do not infer or repeat old tasks from prior chats. If nothing needs attention, reply HEARTBEAT_OK."

建议修复方案

修改 lib/memos-cloud-api.js 中的 buildPromptFromData 函数,将触发心跳检测的指令改写,例如:

  • 改为:"If a HEARTBEAT.md file exists in the workspace, consider its contents for context."
  • 或移除该指令,改为更通用的说明

环境信息

  • Plugin version: 0.1.8
  • OpenClaw version: 2026.2.13

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions