From 512d45aaa4844404e1edaa088545e08ad3911973 Mon Sep 17 00:00:00 2001 From: He Date: Wed, 22 Apr 2026 23:31:08 +0800 Subject: [PATCH] fix(capture): skip "Review the conversation above" internal prompts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Skip internal Hermes → Agent review prompts (role:user) at capture time to prevent them from polluting the memory chunk store. Added REVIEW_CONVERSATION_RE pattern and corresponding skip check in captureMessages(), following the same approach as BOOT_CHECK_RE. --- apps/memos-local-openclaw/src/capture/index.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/apps/memos-local-openclaw/src/capture/index.ts b/apps/memos-local-openclaw/src/capture/index.ts index 10d5282c6..57083b58f 100644 --- a/apps/memos-local-openclaw/src/capture/index.ts +++ b/apps/memos-local-openclaw/src/capture/index.ts @@ -7,6 +7,9 @@ const SYSTEM_BOILERPLATE_RE = /^A new session was started via \/new or \/reset\b // Boot-check / memory-system injection patterns that should never be stored. const BOOT_CHECK_RE = /^(?:You are running a boot check|Read HEARTBEAT\.md if it exists|## Memory system — ACTION REQUIRED)/; +// Agent-internal review prompts — Hermes → Agent instructions, not user content. +const REVIEW_CONVERSATION_RE = /^Review the conversation above/i; + /** * Returns true for sentinel reply values that carry no user-facing content. */ @@ -81,6 +84,10 @@ export function captureMessages( log.debug(`Skipping boot-check injection: ${msg.content.slice(0, 60)}...`); continue; } + if (role === "user" && REVIEW_CONVERSATION_RE.test(msg.content.trim())) { + log.debug(`Skipping agent-internal review prompt: ${msg.content.slice(0, 60)}...`); + continue; + } if (role === "tool" && msg.toolName && SELF_TOOLS.has(msg.toolName)) { log.debug(`Skipping self-tool result: ${msg.toolName}`);