Bug Description
Internal system prompts injected by Hermes Agent — specifically the "Review the conversation above, consider saving..." type prompts — are being stored as role: "user" chunks in the MemTensor memory database, causing noise pollution in long-term memory.
These prompts are instruction strings from the agent framework to itself, not user messages.
Root Cause
Location: apps/memos-local-openclaw/src/capture/index.ts
The captureMessages() function has a SKIP_ROLES filter (skips role: "system") and a BOOT_CHECK_RE pattern filter, but no content filter for "Review the conversation above..." prompts which arrive with role: "user".
Evidence
SELECT COUNT(*) FROM chunks WHERE content LIKE 'Review the conversation above%';
-- Returns: ~37 chunks per production instance
Proposed Fix
Add REVIEW_CONVERSATION_RE and a skip check in captureMessages(), following the same pattern as BOOT_CHECK_RE:
const REVIEW_CONVERSATION_RE = /^Review the conversation above/i;
if (role === "user" && REVIEW_CONVERSATION_RE.test(msg.content.trim())) {
continue; // skip
}
PR with the fix: MemTensor/MemOS#1517
Bug Description
Internal system prompts injected by Hermes Agent — specifically the "Review the conversation above, consider saving..." type prompts — are being stored as
role: "user"chunks in the MemTensor memory database, causing noise pollution in long-term memory.These prompts are instruction strings from the agent framework to itself, not user messages.
Root Cause
Location:
apps/memos-local-openclaw/src/capture/index.tsThe
captureMessages()function has aSKIP_ROLESfilter (skipsrole: "system") and aBOOT_CHECK_REpattern filter, but no content filter for "Review the conversation above..." prompts which arrive withrole: "user".Evidence
Proposed Fix
Add
REVIEW_CONVERSATION_REand a skip check incaptureMessages(), following the same pattern asBOOT_CHECK_RE:PR with the fix: MemTensor/MemOS#1517