Skip to content

feat(openclaw-plugin): add configurable capture skipSessionPatterns#1375

Closed
duoyidavid-eng wants to merge 1 commit into
MemTensor:mainfrom
duoyidavid-eng:feat/capture-skip-session-patterns-v2
Closed

feat(openclaw-plugin): add configurable capture skipSessionPatterns#1375
duoyidavid-eng wants to merge 1 commit into
MemTensor:mainfrom
duoyidavid-eng:feat/capture-skip-session-patterns-v2

Conversation

@duoyidavid-eng

Copy link
Copy Markdown

Summary

Allow users to configure session key substrings to skip memory capture via capture.skipSessionPatterns config option.

Default: [":cron:"] (backward compatible — cron sessions still skipped by default)

Motivation

Previously, only cron sessions were hard-coded to skip capture. Users who run multiple agents (e.g. a dedicated wechat agent) had to modify source code to exclude specific agents from memory capture.

Changes

File Change
src/types.ts Add skipSessionPatterns?: string[] to MemosLocalConfig.capture
src/config.ts Resolve config with default [":cron:"]
src/capture/index.ts Add skipSessionPatterns parameter to captureMessages(), filter before processing
src/index.ts Pass config value to captureMessages()

Example config

{
  "capture": {
    "skipSessionPatterns": [":cron:", "agent:wechat", "agent:bot"]
  }
}

This replaces the previous hard-coded cron check and makes session filtering data-driven.

Allow users to configure session key substrings to skip memory capture
via  config option (default: [:cron:]).

Previously, only cron sessions were hard-coded to skip. This change makes
the filter configurable so users can exclude specific agents or session
types from memory capture without code changes.

Example config:
  capture: { skipSessionPatterns: [:cron:, agent:wechat] }

Co-authored-by: duoyidavid <duoyidavid@gmail.com>
@Hun-ger

Hun-ger commented Apr 20, 2026

Copy link
Copy Markdown
Collaborator

Hi @duoyidavid-eng , thanks for this great initiative! While this PR successfully prevents matched sessions (like cron) from being captured (written) into memory, it doesn't stop them from triggering auto-recall (reading). This means these background sessions will still perform unnecessary memory searches and suffer from context pollution (related to Issue #1311). To fully fix this, the filtering must apply to both phases. Our official team will take over to implement a comprehensive solution that blocks both capture and auto-recall based on your idea. We will likely close this PR in favor of the complete fix, but we truly appreciate your contribution and inspiration!

@Hun-ger Hun-ger closed this Apr 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants