Skip to content

fix(openclaw): OpenClaw corpus supplement mode beside memory-core#195

Merged
wey-gu merged 3 commits into
mainfrom
dev_075
Apr 15, 2026
Merged

fix(openclaw): OpenClaw corpus supplement mode beside memory-core#195
wey-gu merged 3 commits into
mainfrom
dev_075

Conversation

@wey-gu

@wey-gu wey-gu commented Apr 15, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

Release Notes

  • Bug Fixes

    • Fixed corpus supplement behavior when another plugin manages the memory slot
    • Resolved tool registration conflicts in supplement mode
    • Fixed dreaming integration compatibility issues
  • Documentation

    • Updated installation and update instructions
    • Clarified corpus supplement troubleshooting guidance
  • Chores

    • Version bump to 0.8.15

Note

Medium Risk
Changes OpenClaw plugin registration and tool exposure based on the configured memory slot, which can affect startup and which memory_* tools are available in different host configurations.

Overview
Improves OpenClaw corpus supplement coexistence with memory-core by making Nowledge Mem a dual-role plugin (["memory", "context-engine"]) while conditionally registering memory_search/memory_get only when this plugin owns the memory slot, avoiding tool shadowing in supplement mode.

Fixes a supplement-mode startup regression by introducing resolveRegistrationMode() (with tests) to safely derive the memory-slot state (defaulting to memory-core) and wiring that into status/initialization logging.

Bumps the OpenClaw integration and plugin versions to 0.8.16, updates the release validator to enforce dual-role kind, and refreshes docs/install scripts (including a CLI-only upgrade command for the APT package).

Reviewed by Cursor Bugbot for commit 6b27d6d. Bugbot is set up for automated code reviews on this repo. Configure here.

@coderabbitai

coderabbitai Bot commented Apr 15, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@wey-gu has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 33 minutes and 27 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 33 minutes and 27 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9ee600cc-8e09-467e-adc0-1d49715e7308

📥 Commits

Reviewing files that changed from the base of the PR and between 1e94ec6 and 6b27d6d.

⛔ Files ignored due to path filters (1)
  • nowledge-mem-openclaw-plugin/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (7)
  • integrations.json
  • nowledge-mem-openclaw-plugin/CHANGELOG.md
  • nowledge-mem-openclaw-plugin/CLAUDE.md
  • nowledge-mem-openclaw-plugin/openclaw.plugin.json
  • nowledge-mem-openclaw-plugin/package.json
  • nowledge-mem-openclaw-plugin/src/index.js
  • nowledge-mem-openclaw-plugin/tests/register-mode.test.mjs
📝 Walkthrough

Walkthrough

This pull request updates the nowledge-mem OpenClaw plugin from version 0.8.14 to 0.8.15, introducing dual-role capability declaration (kind: ["memory", "context-engine"]), and implements conditional registration of memory tools only when the plugin owns the memory slot. Documentation and installation instructions are also clarified.

Changes

Cohort / File(s) Summary
APT Documentation & Installation
apt/README.md, apt/install.sh
Clarified system-wide upgrade behavior and added explicit CLI instructions for updating only the nowledge-mem package via sudo apt-get install --only-upgrade nowledge-mem.
Version & Manifest Updates
integrations.json, nowledge-mem-openclaw-plugin/package.json, nowledge-mem-openclaw-plugin/openclaw.plugin.json
Bumped plugin version from 0.8.14 to 0.8.15 and changed manifest kind field from single string "memory" to array ["memory", "context-engine"].
Plugin Documentation
nowledge-mem-openclaw-plugin/CHANGELOG.md, nowledge-mem-openclaw-plugin/CLAUDE.md, nowledge-mem-openclaw-plugin/README.md, nowledge-mem-openclaw-plugin/src/context-engine.js
Updated documentation to reflect dual-role declaration and corpus supplement behavior fixes; plugin now remains active alongside memory-core when it owns the supplement slot without shadowing memory tools.
Plugin Registration Logic
nowledge-mem-openclaw-plugin/src/index.js, nowledge-mem-openclaw-plugin/src/register-mode.js
Added resolveRegistrationMode() function to determine memory slot ownership; modified plugin registration to conditionally register memory_search and memory_get tools only when this plugin owns the memory slot, preventing shadowing when memory-core is the active slot.
Validation & Testing
nowledge-mem-openclaw-plugin/scripts/validate-plugin.mjs, nowledge-mem-openclaw-plugin/tests/register-mode.test.mjs
Updated validator to accept kind as an array matching ["memory", "context-engine"]; added comprehensive tests covering memory slot selection and manifest validation scenarios.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

Poem

🐰 A plugin with split personality, declared!
Memory and context, both finely prepared,
No more shadowing when another slot's there,
Version bump brings peace to the registry air!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically summarizes the main change: enabling OpenClaw corpus supplement mode to work alongside memory-core, which aligns with the primary fix across multiple files.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev_075

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@wey-gu

wey-gu commented Apr 15, 2026

Copy link
Copy Markdown
Member Author

bugbot run

@wey-gu

wey-gu commented Apr 15, 2026

Copy link
Copy Markdown
Member Author

@codex review

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
nowledge-mem-openclaw-plugin/src/index.js (1)

100-108: ⚠️ Potential issue | 🔴 Critical

memorySlot is undefined — destructuring mismatch.

Line 102 references memorySlot, but only memorySlotSelected is destructured from resolveRegistrationMode at line 47. This will pass undefined to the status tool.

🐛 Proposed fix
-		const { memorySlotSelected } = resolveRegistrationMode({
+		const { memorySlot, memorySlotSelected } = resolveRegistrationMode({
			pluginId: api.id,
			configuredMemorySlot: api.config?.plugins?.slots?.memory,
		});
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@nowledge-mem-openclaw-plugin/src/index.js` around lines 100 - 108, The status
tool is being passed an undefined memorySlot because resolveRegistrationMode
only returns memorySlotSelected; update the call to
createStatusTool/registerTool to pass the correct variable (memorySlotSelected)
or change resolveRegistrationMode to return memorySlot as well. Locate
resolveRegistrationMode and the registerTool call that invokes createStatusTool
and either (a) replace the passed memorySlot with memorySlotSelected, or (b) add
memorySlot to the destructured return of resolveRegistrationMode so
createStatusTool receives a defined memorySlot.
🧹 Nitpick comments (1)
nowledge-mem-openclaw-plugin/tests/register-mode.test.mjs (1)

7-25: Add one test for the implicit default slot path.

Nice coverage on explicit modes. I’d also pin behavior when configuredMemorySlot is omitted, since resolveRegistrationMode() defaults it to "memory-core".

✅ Suggested additional test
 test("full memory mode registers compatibility tools when Nowledge Mem owns the slot", () => {
 	const mode = resolveRegistrationMode({
 		pluginId: "openclaw-nowledge-mem",
 		configuredMemorySlot: "openclaw-nowledge-mem",
 	});

 	assert.equal(mode.memorySlotSelected, true);
 	assert.equal(mode.registerMemoryCompatTools, true);
 });
+
+test("defaults to memory-core mode when configuredMemorySlot is omitted", () => {
+	const mode = resolveRegistrationMode({
+		pluginId: "openclaw-nowledge-mem",
+	});
+
+	assert.equal(mode.memorySlot, "memory-core");
+	assert.equal(mode.memorySlotSelected, false);
+	assert.equal(mode.registerMemoryCompatTools, false);
+});
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@nowledge-mem-openclaw-plugin/tests/register-mode.test.mjs` around lines 7 -
25, Add a test to assert the implicit default path when configuredMemorySlot is
omitted: call resolveRegistrationMode({ pluginId: "openclaw-nowledge-mem" }) and
assert that it behaves like the explicit "memory-core" case (memorySlotSelected
=== false and registerMemoryCompatTools === false); place this new case
alongside the existing tests in register-mode.test.mjs so
resolveRegistrationMode's defaulting behavior is covered.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@nowledge-mem-openclaw-plugin/CLAUDE.md`:
- Around line 85-88: Update the wording describing the memory-slot activation so
it matches runtime behavior: change the “Always active” claim for the
memory-slot (which provides memory_search + memory_get) to state that these
compatibility hooks are active only when the slot is selected via
plugins.slots.memory (e.g., plugins.slots.memory = "openclaw-nowledge-mem") and
are not active in supplement mode when using memory-core; also preserve the note
that the context-engine role is separately activated via
plugins.slots.contextEngine = "nowledge-mem".

---

Outside diff comments:
In `@nowledge-mem-openclaw-plugin/src/index.js`:
- Around line 100-108: The status tool is being passed an undefined memorySlot
because resolveRegistrationMode only returns memorySlotSelected; update the call
to createStatusTool/registerTool to pass the correct variable
(memorySlotSelected) or change resolveRegistrationMode to return memorySlot as
well. Locate resolveRegistrationMode and the registerTool call that invokes
createStatusTool and either (a) replace the passed memorySlot with
memorySlotSelected, or (b) add memorySlot to the destructured return of
resolveRegistrationMode so createStatusTool receives a defined memorySlot.

---

Nitpick comments:
In `@nowledge-mem-openclaw-plugin/tests/register-mode.test.mjs`:
- Around line 7-25: Add a test to assert the implicit default path when
configuredMemorySlot is omitted: call resolveRegistrationMode({ pluginId:
"openclaw-nowledge-mem" }) and assert that it behaves like the explicit
"memory-core" case (memorySlotSelected === false and registerMemoryCompatTools
=== false); place this new case alongside the existing tests in
register-mode.test.mjs so resolveRegistrationMode's defaulting behavior is
covered.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9435cca9-dbbb-4f80-9058-2f00365462f5

📥 Commits

Reviewing files that changed from the base of the PR and between 6434ef2 and 1e94ec6.

⛔ Files ignored due to path filters (1)
  • nowledge-mem-openclaw-plugin/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (13)
  • apt/README.md
  • apt/install.sh
  • integrations.json
  • nowledge-mem-openclaw-plugin/CHANGELOG.md
  • nowledge-mem-openclaw-plugin/CLAUDE.md
  • nowledge-mem-openclaw-plugin/README.md
  • nowledge-mem-openclaw-plugin/openclaw.plugin.json
  • nowledge-mem-openclaw-plugin/package.json
  • nowledge-mem-openclaw-plugin/scripts/validate-plugin.mjs
  • nowledge-mem-openclaw-plugin/src/context-engine.js
  • nowledge-mem-openclaw-plugin/src/index.js
  • nowledge-mem-openclaw-plugin/src/register-mode.js
  • nowledge-mem-openclaw-plugin/tests/register-mode.test.mjs

Comment thread nowledge-mem-openclaw-plugin/CLAUDE.md

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1e94ec68dd

ℹ️ 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".

Comment thread nowledge-mem-openclaw-plugin/src/index.js Outdated
Comment thread nowledge-mem-openclaw-plugin/src/index.js
@wey-gu

wey-gu commented Apr 15, 2026

Copy link
Copy Markdown
Member Author

@codex review

@wey-gu

wey-gu commented Apr 15, 2026

Copy link
Copy Markdown
Member Author

bugbot run

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

ℹ️ 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".

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 6b27d6d. Configure here.

@wey-gu wey-gu merged commit 0dbb9f4 into main Apr 15, 2026
2 checks passed
@wey-gu wey-gu deleted the dev_075 branch April 15, 2026 02:45
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.

1 participant