fix: register memory runtime for OpenClaw 2026.4.1#449
fix: register memory runtime for OpenClaw 2026.4.1#449ChaoYang78 wants to merge 1 commit intoCortexReach:masterfrom
Conversation
AliceLJY
left a comment
There was a problem hiding this comment.
Review: LGTM
Summary: Registers a memory runtime adapter via api.registerMemoryRuntime() so OpenClaw 2026.4.1+ recognizes memory-lancedb-pro as an active backend. Single file, single commit, focused change.
Verified:
- All referenced internals exist and signatures match:
resolveScopeFilter,scopeManager,retriever.retrieve,store.getById,store.stats,embedder.embedQuery,clampInt,basename,vectorDim,resolvedDbPath,getDefaultWorkspaceDir,config.embedding.model. source: "manual"is a valid enum value forRetrievalContext.source.store.getById(id, scopeFilter)andstore.stats(scopeFilter)accept the correct parameter shapes.- Insertion point is correct (after tool registrations, before CLI commands section).
Observations:
- Reuses existing plugin internals rather than introducing a parallel backend path -- correct design choice.
- Lifecycle management is sound:
close()andcloseAllMemorySearchManagers()are intentional no-ops because the plugin owns the store lifecycle. Good. - Input validation in
readFileandsearchis defensive (clampInt,Math.max,Math.floor, type checks with fallbacks). Good. getByIdlookup by basename inreadFilestrips.mdsuffix before querying -- matches the synthetic path format fromsyntheticPathForId. Consistent.- Minor note:
scopeFilteris captured once atgetMemorySearchManagercall time. If scope resolution is meant to be dynamic per-call, this would need to move inside each method. However, given that OpenClaw creates managers per-agent and the existing plugin scope model is per-session, capturing at creation time is correct.
No bugs, no security issues, no unnecessary changes. Approved.
Reviewed by: AliceLJY (via Claude Code)
Review: register memory runtime for OpenClaw 2026.4.1Verdict: request-changes | Confidence: 0.90 | Value: 45% Important compatibility fix — without Must Fix
The OpenClaw SDK type definition ( Fix: if (typeof api.registerMemoryRuntime === 'function') {
api.registerMemoryRuntime({ ... });
}This makes it backward-compatible with pre-2026.4.1 hosts and fixes all test failures. Update test mocks to include Also
Auto-reviewed by auto-pr-review-orchestrator | 6 rounds | Claude + Codex adversarial |
|
> Thanks — good catch. I’ve updated the patch to make the runtime registration backward-compatible.
>
> `api.registerMemoryRuntime(...)` is now guarded behind a feature check, so older hosts and test harnesses that don’t expose that API no longer crash:
>
> ```ts
> if (typeof api.registerMemoryRuntime === "function") {
> api.registerMemoryRuntime({ ... })
> }
> ```
>
> I also updated the affected test mocks/harnesses to include `registerMemoryRuntime() {}` where appropriate.
>
> I kept the change scoped to the compatibility issue you flagged rather than mixing in unrelated existing test failures.
>
> I’ll rebase onto `main` next.
Stone
…------------------ Original ------------------
From: Rwm Jhb ***@***.***>
Date: Fri,Apr 3,2026 2:28 PM
To: CortexReach/memory-lancedb-pro ***@***.***>
Cc: Kevin Stone ***@***.***>, Author ***@***.***>
Subject: Re: [CortexReach/memory-lancedb-pro] fix: register memory runtime for OpenClaw 2026.4.1 (PR #449)
rwmjhb left a comment (CortexReach/memory-lancedb-pro#449)
Review: register memory runtime for OpenClaw 2026.4.1
Verdict: request-changes | Confidence: 0.90 | Value: 45%
Important compatibility fix — without registerMemoryRuntime(), the plugin is invisible to OpenClaw 2026.4.1's backend discovery. One issue blocks merge:
Must Fix
api.registerMemoryRuntime() called unconditionally — crashes on older hosts and all test harnesses
index.ts:2099 calls api.registerMemoryRuntime(...) without checking if the method exists. This crashes:
plugin-manifest-regression.mjs:146 — TypeError at registration
reflection-bypass-hook.test.mjs — all 4 tests fail
Any mock API that doesn't stub this method (recall-text-cleanup.test.mjs, resolve-env-vars-array.test.mjs, etc.)
The OpenClaw SDK type definition (plugins/types.ts) also doesn't declare this method yet, so it's not guaranteed on all host versions.
Fix:
if (typeof api.registerMemoryRuntime === 'function') { api.registerMemoryRuntime({ ... }); }
This makes it backward-compatible with pre-2026.4.1 hosts and fixes all test failures. Update test mocks to include registerMemoryRuntime: () => {} for coverage of the new path.
Also
Rebase onto main (stale base)
Auto-reviewed by auto-pr-review-orchestrator | 6 rounds | Claude + Codex adversarial
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Summary
Register a memory runtime adapter so
memory-lancedb-prois recognized as the active memory backend by OpenClaw 2026.4.1+.Problem
After upgrading OpenClaw to
2026.4.1, the plugin still appeared to load successfully:memory-lancedb-pro@1.1.0-beta.10: plugin registeredBut OpenClaw system-level diagnostics still reported that no active memory plugin/runtime was available, for example:
No active memory plugin is registered for the current config.memory-lancedb-proThis created a half-working state where the plugin looked loaded, but OpenClaw's runtime-facing memory integration could not treat it as an active backend.
Root cause
OpenClaw
2026.4.1expects memory plugins to explicitly register a memory runtime via:api.registerMemoryRuntime(...)memory-lancedb-prowas not doing that yet.What this PR changes
This PR adds a minimal runtime adapter that wires the existing plugin internals into OpenClaw's memory runtime contract:
getMemorySearchManager(...)search(...)readFile(...)status()probeEmbeddingAvailability()probeVectorAvailability()resolveMemoryBackendConfig()The implementation intentionally reuses the plugin's existing store / retriever / embedder / scope resolution logic rather than introducing a second backend path.
Validation
Validated locally against OpenClaw
2026.4.1by:openclaw doctor --non-interactivesuccessfully with plugin errors = 0Notes
This PR only includes the runtime-registration fix needed for OpenClaw 2026.4.1 compatibility. It intentionally excludes unrelated working-tree changes.