Skip to content

fix(manifest): declare memory kind and register memory capability#132

Open
YOMXXX wants to merge 1 commit into
TencentCloud:mainfrom
YOMXXX:fix/119-declare-memory-kind
Open

fix(manifest): declare memory kind and register memory capability#132
YOMXXX wants to merge 1 commit into
TencentCloud:mainfrom
YOMXXX:fix/119-declare-memory-kind

Conversation

@YOMXXX
Copy link
Copy Markdown
Contributor

@YOMXXX YOMXXX commented Jun 3, 2026

Summary

Fixes #119openclaw doctor reports "memory slot plugin not found" even though memory-tencentdb is loaded and serving four-layer memory.

Root cause

The host's slot loader matches memory plugins via hasKind(record.kind, "memory") and only accepts registerMemoryCapability(...) from plugins whose manifest declares that kind. memory-tencentdb's manifest never set kind, and the plugin never called registerMemoryCapability. So from the host's view the memory slot is empty — doctor surfaces that as the missing-slot warning.

Change

  • openclaw.plugin.json: add "kind": "memory" so the loader recognizes this plugin as a memory-kind candidate.
  • index.ts: in register(), feature-detect api.registerMemoryCapability and call it with an empty capability {} to claim the slot. The slot loader requires kind: "memory" before accepting the call (verified against the bundled OpenClaw SDK).
    • Wrapped in try/catch and feature-detected via typeof === "function" so older OpenClaw hosts (before the API existed) still load the plugin without error.
    • Logged at debug (success) / warn (failure) — non-fatal either way.

Empty {} is sufficient for slot-occupancy. promptBuilder / runtime / publicArtifacts can be wired later if we want the host to drive prompt sections or flush plans through its own memory pipeline; that's a follow-up, not part of this fix.

Test plan

  • Build still passes (npm run build)
  • On a fresh OpenClaw install, openclaw doctor no longer reports "memory slot plugin not found"
  • On an OpenClaw host older than the registerMemoryCapability API, the plugin still loads and runtime hooks fire (feature detection skips the call)

OpenClaw `doctor` reports "memory slot plugin not found" because the
plugin manifest never declared `"kind": "memory"` and never called the
host's `registerMemoryCapability` API. Without those, the host loader
skips this plugin when matching the memory slot and the doctor check
treats the slot as unfilled.

- openclaw.plugin.json: declare `"kind": "memory"` so the loader
  recognizes this plugin as a memory-kind candidate.
- index.ts: feature-detect `api.registerMemoryCapability` and call it
  with an empty capability to claim the slot. The empty capability is
  sufficient for slot-occupancy; promptBuilder/runtime can be wired
  later if we want the host to drive prompt sections through its own
  memory pipeline. Wrapped in try/catch and feature-detected so older
  OpenClaw hosts without this API still load the plugin.

Fixes TencentCloud#119

Signed-off-by: 李冠辰 <liguanchen@xiaomi.com>
@Maxwell-Code07
Copy link
Copy Markdown
Collaborator

Thanks for the contribution! We've received your PR fixing the OpenClaw doctor false alarm and will review it internally. We'll get back to you once we have results. Appreciate you tracking down this manifest issue!

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.

[Bug] Bug Report:doctor 误报 "memory slot plugin not found"

2 participants