fix(openclaw): skip retain for operational session patterns#1410
Open
vernmic wants to merge 2 commits into
Open
fix(openclaw): skip retain for operational session patterns#1410vernmic wants to merge 2 commits into
vernmic wants to merge 2 commits into
Conversation
nicoloboschi
reviewed
May 4, 2026
| // These sessions are machine-driven and produce low-value or duplicative retains | ||
| if ( | ||
| agentEndSessionKey && ( | ||
| agentEndSessionKey.includes(":heartbeat") || |
Collaborator
There was a problem hiding this comment.
good idea, can we make this list configurable via plugin config with these ones as default?
vernmic
added a commit
to vernmic/hindsight
that referenced
this pull request
May 4, 2026
Replace hardcoded session pattern includes() checks with a configurable skipRetainSessionPatterns array in plugin config. Uses the existing glob pattern system (compileSessionPatterns/matchesSessionPattern) for matching. Default patterns preserve current behavior: **:heartbeat**, **:cron:**, **:subagent:**, **:autonomic:** Users can customize via plugin config: skipRetainSessionPatterns: ['**:heartbeat**', '**:custom:**'] Addresses nicoloboschi review feedback on PR vectorize-io#1410.
vernmic
added a commit
to vernmic/hindsight
that referenced
this pull request
May 4, 2026
Replace hardcoded session pattern includes() checks with a configurable skipRetainSessionPatterns array in plugin config. Bare tokens like 'heartbeat' are auto-wrapped as glob patterns '**:heartbeat**'. Default patterns preserve current behavior: heartbeat, cron, subagent, autonomic Users can customize via plugin config: skipRetainSessionPatterns: ['heartbeat', 'cron', 'custom-pattern'] - Add skipRetainSessionPatterns to PluginConfig type - Add bare-token-to-glob wrapping in getPluginConfig - Replace hardcoded includes() with compileSessionPatterns matching - Add tests for wrapping logic and pattern matching - Document new config field in openclaw.md Addresses nicoloboschi review feedback on PR vectorize-io#1410.
6710f72 to
62a9fc8
Compare
vernmic
added a commit
to vernmic/hindsight
that referenced
this pull request
May 4, 2026
Replace hardcoded session pattern includes() checks with a configurable skipRetainSessionPatterns array in plugin config. Uses the existing glob pattern system (compileSessionPatterns/matchesSessionPattern) for matching. Default patterns preserve current behavior: **:heartbeat**, **:cron:**, **:subagent:**, **:autonomic:** Users can customize via plugin config: skipRetainSessionPatterns: ['**:heartbeat**', '**:custom:**'] Addresses nicoloboschi review feedback on PR vectorize-io#1410.
vernmic
added a commit
to vernmic/hindsight
that referenced
this pull request
May 4, 2026
Replace hardcoded session pattern includes() checks with a configurable skipRetainSessionPatterns array in plugin config. Bare tokens like 'heartbeat' are auto-wrapped as glob patterns '**:heartbeat**'. Default patterns preserve current behavior: heartbeat, cron, subagent, autonomic Users can customize via plugin config: skipRetainSessionPatterns: ['heartbeat', 'cron', 'custom-pattern'] - Add skipRetainSessionPatterns to PluginConfig type - Add bare-token-to-glob wrapping in getPluginConfig - Replace hardcoded includes() with compileSessionPatterns matching - Add tests for wrapping logic and pattern matching - Document new config field in openclaw.md Addresses nicoloboschi review feedback on PR vectorize-io#1410.
vernmic
added a commit
to vernmic/hindsight
that referenced
this pull request
May 4, 2026
Add skipRetainSessionPatterns config field to control which session types skip memory retention. Supports glob patterns and bare tokens (heartbeat, cron, subagent, autonomic) that auto-wrap as **:token**. Fixes vectorize-io#1410
6e132ad to
637b081
Compare
vernmic
added a commit
to vernmic/hindsight
that referenced
this pull request
May 4, 2026
Replace hardcoded includes() checks with configurable glob patterns via new skipRetainSessionPatterns config field. Bare tokens like 'heartbeat' auto-wrap as '**:heartbeat**'. Adds PluginConfig type, 4 unit tests, and documentation in openclaw integration docs. Per PR vectorize-io#1410 reviewer feedback.
637b081 to
522a7c2
Compare
vernmic
added a commit
to vernmic/hindsight
that referenced
this pull request
May 4, 2026
Replace hardcoded includes() checks with configurable glob patterns via new skipRetainSessionPatterns config field. Bare tokens like 'heartbeat' auto-wrap as '**:heartbeat**'. Adds PluginConfig type, 4 unit tests, and documentation in openclaw integration docs. Per PR vectorize-io#1410 reviewer feedback.
522a7c2 to
a871dc3
Compare
vernmic
added a commit
to vernmic/hindsight
that referenced
this pull request
May 4, 2026
Replace hardcoded includes() checks with configurable glob patterns via new skipRetainSessionPatterns config field. Bare tokens like 'heartbeat' auto-wrap as '**:heartbeat**'. Adds PluginConfig type, 4 unit tests, and documentation in openclaw integration docs. Also regenerates skills/hindsight-docs/references/developer/configuration.md via generate-docs-skill.sh. The removed HINDSIGHT_API_LLM_DEFAULT_HEADERS entry is a pre-existing upstream sync issue: the source hindsight-docs/docs/developer/configuration.md already dropped this line but the committed generated copy hadn't been regenerated. Including the regenerated version to satisfy CI's generated-file-sync check. Per PR vectorize-io#1410 reviewer feedback.
ab32639 to
3b227d9
Compare
vernmic
added a commit
to vernmic/hindsight
that referenced
this pull request
May 7, 2026
Replace the opaqueness of a single ignoreSessionPatterns knob for machine-driven session types with a dedicated, configurable skipRetainSessionPatterns field. Unlike full ignore (no recall + no retain), this gate only skips retain — recall still fires, which means agents can still learn from past operational sessions even if the transcripts themselves aren't worth retaining. Bare tokens like 'heartbeat' auto-wrap as glob patterns '**:heartbeat**'. Users who need glob-wildcard patterns can pass them directly. Defaults: heartbeat, cron, subagent (the three session types confirmed in core OpenClaw source). autonomic removed from defaults — it does not appear in openclaw/openclaw code, session-key-utils, or docs. Users with custom session types can configure them via skipRetainSessionPatterns or the existing ignoreSessionPatterns field. Refs: vectorize-io#1403, PR review feedback on vectorize-io#1410
vernmic
added a commit
to vernmic/hindsight
that referenced
this pull request
May 7, 2026
Replace the opaqueness of a single ignoreSessionPatterns knob for machine-driven session types with a dedicated, configurable skipRetainSessionPatterns field. Unlike full ignore (no recall + no retain), this gate only skips retain — recall still fires, which means agents can still learn from past operational sessions even if the transcripts themselves aren't worth retaining. Bare tokens like 'heartbeat' auto-wrap as glob patterns '**:heartbeat**'. Users who need glob-wildcard patterns can pass them directly. Defaults: heartbeat, cron, subagent (the three session types confirmed in core OpenClaw source). autonomic removed from defaults — it does not appear in openclaw/openclaw code, session-key-utils, or docs. Users with custom session types can configure them via skipRetainSessionPatterns or the existing ignoreSessionPatterns field. Refs: vectorize-io#1403, PR review feedback on vectorize-io#1410
3b227d9 to
6886fbe
Compare
Replace the opaqueness of a single ignoreSessionPatterns knob for machine-driven session types with a dedicated, configurable skipRetainSessionPatterns field. Unlike full ignore (no recall + no retain), this gate only skips retain — recall still fires, which means agents can still learn from past operational sessions even if the transcripts themselves aren't worth retaining. Bare tokens like 'heartbeat' auto-wrap as glob patterns '**:heartbeat**'. Users who need glob-wildcard patterns can pass them directly. Defaults: heartbeat, cron, subagent (the three session types confirmed in core OpenClaw source). autonomic removed from defaults — it does not appear in openclaw/openclaw code, session-key-utils, or docs. Users with custom session types can configure them via skipRetainSessionPatterns or the existing ignoreSessionPatterns field. Refs: vectorize-io#1403, PR review feedback on vectorize-io#1410
6886fbe to
a9a4341
Compare
The verify-generated-files CI job runs lint.sh (prettier) across all integration packages and fails if any file changes. This n8n test file was not prettier-formatted in upstream/main, causing the CI gate to fail on this branch. Prettier reformat only — no behavioral change. The cast expression on lines 37-39 was split across three lines to stay within the 100-char printWidth limit configured in the root .prettierrc.json. Not related to the skipRetainSessionPatterns change. Committed here because the repo-wide verify-generated-files check blocks all PRs regardless of which integration they touch.
nicoloboschi
requested changes
May 8, 2026
| statelessSessionPatterns: Array.isArray(config.statelessSessionPatterns) | ||
| ? config.statelessSessionPatterns | ||
| : [], | ||
| skipRetainSessionPatterns: (() => { |
Collaborator
There was a problem hiding this comment.
we can't se this as default - default must be empty array (disabled
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Heartbeat, cron, subagent, and autonomic sessions are machine-driven and produce low-value or duplicative retains. Add a defense-in-depth gate that checks sessionKey patterns before any retention logic runs.
The :autonomic: pattern was missing from the upstream skip regex, causing autonomic sessions to flood the memory bank with procedural noise.
Closes: #1403