fix(plugins): exempt dreaming engine from memory slot fast-path in loader#65411
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d23d01b239
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Greptile SummaryThis PR exempts The primary fix target ( Confidence Score: 5/5Safe to merge; all remaining findings are P2 and limited to narrow edge cases or missing tests. The primary fix (dreaming engine coexistence with a different slot plugin) is logically correct. The two findings are P2: a false-positive diagnostic in an edge case requiring an explicit redundant src/plugins/loader.ts — path-2 ( Prompt To Fix All With AIThis is a comment left during a code review.
Path: src/plugins/loader.ts
Line: 1522-1546
Comment:
**`memorySlotMatched` not set when dreaming engine IS the configured slot**
When `memorySlot === dreamingEngineId` (e.g., user has explicitly set `plugins.slots.memory = "memory-core"` and also enabled dreaming), the `pluginId !== dreamingEngineId` guard skips the entire path-2 block. In the `!shouldLoadModules` code path (used by tooling that calls `loadOpenClawPlugins` with `loadModules: false`), execution then hits the `continue` at line 1563–1566 before the module-loading path (line 1668) can update `memorySlotMatched`. This leaves `memorySlotMatched = false`, triggering the false-positive diagnostic at line 1790: `"memory slot plugin not found or not marked as memory: memory-core"`.
The issue doesn't affect the primary fix target (`memorySlot = "memory-lancedb"`, dreaming enabled), but it is a regression for the edge case where `memory-core` is the explicit slot. A simple guard would resolve it:
```
if (!shouldLoadModules && registrationMode === "full") {
if (pluginId === dreamingEngineId && hasKind(record.kind, "memory") && memorySlot === pluginId) {
selectedMemoryPluginId = record.id;
memorySlotMatched = true;
record.memorySlotSelected = true;
} else if (pluginId !== dreamingEngineId) {
// ... existing logic unchanged
}
}
```
The same pattern applies to path 3 (around line 1672) if both paths can be reached with `memorySlot === dreamingEngineId`.
How can I resolve this? If you propose a fix, please make it concise.
---
This is a comment left during a code review.
Path: src/plugins/loader.ts
Line: 1293-1299
Comment:
**No tests cover the new dreaming-engine exemption behavior**
The three-path exemption logic (plus the CLI-registry path) is non-trivial, yet no new test cases were added to `loader.test.ts`. The test plan verifies existing tests still pass but doesn't add coverage for the targeted scenario or for the regression guard. Consider adding tests for at least these two cases:
- `memory-lancedb` as slot + dreaming enabled at `memory-lancedb`'s config → both `memory-core` and `memory-lancedb` appear in the loaded registry, `memory-lancedb` has `memorySlotSelected: true`, `memory-core` does not.
- Same config with dreaming disabled → `memory-core` is absent (slot-policy exclusion still applies).
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "fix(plugins): exempt dreaming engine fro..." | Re-trigger Greptile |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: aa1f1c9ffd
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
aa1f1c9 to
3228f68
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 38c0516fc8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const dreamingConfig = resolveMemoryDreamingConfig({ | ||
| pluginConfig: resolveMemoryDreamingPluginConfig(params.cfg), | ||
| cfg: params.cfg, | ||
| }); | ||
| return dreamingConfig.enabled ? DEFAULT_MEMORY_DREAMING_PLUGIN_ID : null; |
There was a problem hiding this comment.
Validate slot owner before enabling dreaming sidecar
resolveDreamingSidecarEngineId enables the memory-core exemption based only on dreaming.enabled and a non-none/non-memory-core slot string, but it never checks that the configured slot plugin actually exists and is a memory plugin. Because later slot checks are skipped for that id, a stale config like plugins.slots.memory = "memory-lancedb" with plugins.entries.memory-lancedb.config.dreaming.enabled = true will load memory-core even when memory-lancedb is missing or not memory-kind, which breaks fail-closed slot behavior and can silently route memory operations to the wrong backend.
Useful? React with 👍 / 👎.
…ader (openclaw#65411) * fix(plugins): exempt dreaming engine from memory slot fast-path in loader * fix(plugins): handle dreaming engine as slot + add tests for slot coexistence * fix(plugins): narrow dreaming sidecar loading * Update CHANGELOG.md * Update CHANGELOG.md --------- Co-authored-by: Vincent Koc <[email protected]>
…ader (openclaw#65411) * fix(plugins): exempt dreaming engine from memory slot fast-path in loader * fix(plugins): handle dreaming engine as slot + add tests for slot coexistence * fix(plugins): narrow dreaming sidecar loading * Update CHANGELOG.md * Update CHANGELOG.md --------- Co-authored-by: Vincent Koc <[email protected]>
…ader (openclaw#65411) * fix(plugins): exempt dreaming engine from memory slot fast-path in loader * fix(plugins): handle dreaming engine as slot + add tests for slot coexistence * fix(plugins): narrow dreaming sidecar loading * Update CHANGELOG.md * Update CHANGELOG.md --------- Co-authored-by: Vincent Koc <[email protected]>
…ader (openclaw#65411) * fix(plugins): exempt dreaming engine from memory slot fast-path in loader * fix(plugins): handle dreaming engine as slot + add tests for slot coexistence * fix(plugins): narrow dreaming sidecar loading * Update CHANGELOG.md * Update CHANGELOG.md --------- Co-authored-by: Vincent Koc <[email protected]>
…ader (openclaw#65411) * fix(plugins): exempt dreaming engine from memory slot fast-path in loader * fix(plugins): handle dreaming engine as slot + add tests for slot coexistence * fix(plugins): narrow dreaming sidecar loading * Update CHANGELOG.md * Update CHANGELOG.md --------- Co-authored-by: Vincent Koc <[email protected]>
…ader (openclaw#65411) * fix(plugins): exempt dreaming engine from memory slot fast-path in loader * fix(plugins): handle dreaming engine as slot + add tests for slot coexistence * fix(plugins): narrow dreaming sidecar loading * Update CHANGELOG.md * Update CHANGELOG.md --------- Co-authored-by: Vincent Koc <[email protected]>
Summary
5e2136c6aefixedchannel-plugin-ids.tsso thatmemory-core(the dreaming engine) is included in gateway startup plugin IDs when dreaming is enabled — but the loader had three independent slot-policy fast-paths that still blockedmemory-corefrom loading whenplugins.slots.memoryis set to a different plugin (e.g.memory-lancedb).DEFAULT_MEMORY_DREAMING_PLUGIN_ID(memory-core) from all three slot-policy exclusion checks inloadOpenClawPluginsandloadOpenClawPluginCliRegistry— but only when dreaming is actually enabled in config.memory-coreandmemory-lancedbnow coexist correctly, completing what5e2136c6aeintended.Test plan
pnpm buildpassespnpm test src/plugins/loader.test.ts src/plugins/channel-plugin-ids.test.ts— all 87 tests passplugins.slots.memory = "memory-lancedb"andplugins.entries.memory-lancedb.config.dreaming.enabled = truestarts with 8 plugins includingmemory-corefalse) still starts withoutmemory-core(slot-only mode unchanged)🤖 Generated with Claude Code