fix: complete Issue #492 protection -- per-agent exclusion + configurable serial cooldown#521
Closed
jlin53882 wants to merge 3 commits intoCortexReach:masterfrom
Closed
fix: complete Issue #492 protection -- per-agent exclusion + configurable serial cooldown#521jlin53882 wants to merge 3 commits intoCortexReach:masterfrom
jlin53882 wants to merge 3 commits intoCortexReach:masterfrom
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
jlin53882
added a commit
to jlin53882/memory-lancedb-pro
that referenced
this pull request
Apr 4, 2026
Revert all changes except the isOwnedByAgent fix (src/reflection-store.ts): - Remove import-markdown CLI (cli.ts) — tracked separately in PR CortexReach#426/CortexReach#482 - Remove autoRecallExcludeAgents config — tracked separately in PR CortexReach#516/CortexReach#521 - Remove idempotent register guard — separate feature request needed - Remove recallMode parsing — unrelated to CortexReach#448 - Remove dual-memory docs (README.md) — already merged in PR CortexReach#367 - Remove script mode changes — unrelated - Remove embedder/llm-client changes — unrelated - Restore deleted nvidia test file — unrelated to CortexReach#448 Only src/reflection-store.ts isOwnedByAgent fix remains.
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.
Problem
Issue #492: memoryReflection hooks in before_prompt_build synchronously execute
LanceDB queries on every user session, causing 30-50% of sessions to fail.
Solution
Per-agent exclusion mechanism via autoRecallExcludeAgents + configurable serial cooldown.
Changes
1. isAgentOrSessionExcluded helper
Supports exact/wildcard-prefix/temp:* patterns.
2. Fixed auto-recall before_prompt_build exclusion check
Removed ineffective agentId !== undefined check.
3. Added exclusion checks to both reflection before_prompt_build hooks (priority 12 & 15)
isInternal guard + exclusion check.
4. Three-layer guard on runMemoryReflection command hook
5. serialCooldownMs now configurable
Added to PluginConfig interface and openclaw.plugin.json schema.
Users can adjust via openclaw.json without code changes.
6. openclaw.plugin.json schema fixes
(OpenClaw would strip these due to additionalProperties: false without schema definitions)
7. Added internal session guard to appendSelfImprovementNote
Consistent with agent:bootstrap hook.
8. Enhanced early-return logging with sessionKey/sessionId
Protection Matrix
openclaw.json Usage
{ "memory-lancedb-pro": { "memoryReflection": { "serialCooldownMs": 60000 }, "autoRecallExcludeAgents": ["memory-distiller", "pi-", "temp:*"] } }Questions for Maintainers
Supersedes: closed PRs #515 and #520
Related to: #492
See also: Issue #514