[codex] Fix mem9 OpenClaw memory capability registration#201
Conversation
✅ Deploy Preview for mem9 canceled.
|
There was a problem hiding this comment.
💡 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".
| return trimmed.startsWith(MEM9_MEMORY_PATH_PREFIX) | ||
| ? trimmed.slice(MEM9_MEMORY_PATH_PREFIX.length) | ||
| : trimmed; |
There was a problem hiding this comment.
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 👍 / 👎.
Summary
capabilities: ["memory"]metadata to the mem9 OpenClaw plugin entryregisterMemoryCapability, legacyregisterMemoryPromptSection/registerMemoryRuntime, and the olderregisterCapability("memory")fallbackquery/q,id/path, andmem9/<id>lookupsWhy
OpenClaw was still treating
mem9as a non-capability or hook-only plugin in some host versions, which leftdoctorreporting 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
Validation
cd openclaw-plugin && npm run typecheckFixes #197.