Skip to content

[codex] Fix mem9 OpenClaw memory capability registration#201

Open
Bosn wants to merge 2 commits into
mainfrom
plugin/fix-openclaw-new-version-compability
Open

[codex] Fix mem9 OpenClaw memory capability registration#201
Bosn wants to merge 2 commits into
mainfrom
plugin/fix-openclaw-new-version-compability

Conversation

@Bosn

@Bosn Bosn commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add static capabilities: ["memory"] metadata to the mem9 OpenClaw plugin entry
  • register the memory slot across OpenClaw host generations using registerMemoryCapability, legacy registerMemoryPromptSection/registerMemoryRuntime, and the older registerCapability("memory") fallback
  • normalize memory tool inputs and outputs so older and newer hosts can interoperate on query/q, id/path, and mem9/<id> lookups

Why

OpenClaw was still treating mem9 as a non-capability or hook-only plugin in some host versions, which left doctor reporting that no active memory plugin was registered even though the mem9 tools were available. This change makes mem9 advertise and register itself as the active memory provider while keeping compatibility with older OpenClaw releases.

Impact

  • OpenClaw hosts that inspect static plugin metadata can now see mem9 as a memory-capable plugin
  • OpenClaw 2026.4.2-era hosts can bind mem9 through the legacy memory runtime APIs
  • newer hosts can use the unified memory capability path without regressing older installs

Validation

  • cd openclaw-plugin && npm run typecheck

Fixes #197.

@netlify

netlify Bot commented Apr 7, 2026

Copy link
Copy Markdown

Deploy Preview for mem9 canceled.

Name Link
🔨 Latest commit 7d7cebb
🔍 Latest deploy log https://app.netlify.com/projects/mem9/deploys/69d4e4bfdbc6800008a65336

@Bosn
Bosn marked this pull request as ready for review April 7, 2026 10:56
@Bosn
Bosn requested a review from Yuiham April 7, 2026 10:56

@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: 4fca9799d3

ℹ️ 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 openclaw-plugin/index.ts
Comment on lines +38 to +40
return trimmed.startsWith(MEM9_MEMORY_PATH_PREFIX)
? trimmed.slice(MEM9_MEMORY_PATH_PREFIX.length)
: trimmed;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Strip line anchors from mem9 lookup paths

memory_search now emits citations like mem9/<id>#L1, but normalizeMemoryLookup only removes the mem9/ prefix and leaves the #L... suffix intact. When that citation-style value is passed back into memory_get/runtime file reads, the backend lookup is attempted with id#L1 and returns not found, so citation follow-up retrieval can fail even though the memory exists. Normalize by dropping fragment anchors before calling backend.get.

Useful? React with 👍 / 👎.

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.

Incompatibility with OpenClaw 2026.4.2: plugin register returns promise (async registration ignored), memory slot not registered

1 participant