Skip to content

memory-wiki bridge import returns 0 artifacts — publicArtifacts capability not accessible to wiki plugin #68828

Description

@fkc0p

Summary

wiki.bridge.import always returns 0 artifacts even though memory-core registers publicArtifacts.listArtifacts via api.registerMemoryCapability(). The wiki plugin's listActiveMemoryPublicArtifacts() silently returns an empty array because memoryPluginState.capability is undefined/null at call time.

Steps to Reproduce

  1. Configure memory-core as plugins.slots.memory with a workspace containing MEMORY.md and memory/*.md files
  2. Configure memory-wiki with vaultMode: "bridge" and all bridge options enabled
  3. Run openclaw gateway call wiki.bridge.import --json
  4. Observe: artifactCount: 0, workspaces: 0

Expected Behavior

listArtifacts() in memory-core should find MEMORY.md, daily notes, dream reports, and event logs from the configured workspace(s), and bridge import should create wiki source pages from them.

Actual Behavior

artifactCount: 0 consistently, even after gateway restart.

Root Cause Analysis

The call chain:

  1. memory-core registers capability: api.registerMemoryCapability({ publicArtifacts: { listArtifacts: listMemoryCorePublicArtifacts } }) — this calls registerMemoryCapability(pluginId, capability) which sets memoryPluginState.capability
  2. wiki plugin calls listActiveMemoryPublicArtifacts({ cfg: appConfig }) which reads memoryPluginState.capability?.capability.publicArtifacts?.listArtifacts(params)
  3. The result is always [] (the ?? [] fallback)

memoryPluginState is a module-level singleton in memory-state-CKpinHhR.js. Both plugins run in the gateway process, but memoryPluginState.capability appears to be null when wiki accesses it.

Possible causes:

  • ESM/CJS module instance split: memory-core imports memory-state-CKpinHhR.js via one path, wiki imports it via another, resulting in two separate singleton instances
  • Plugin loading order: wiki loads and caches the reference before memory-core registers
  • Module resolution path mismatch: the bundled dist filename includes a content hash (CKpinHhR), and if plugins resolve it differently the singleton diverges

Environment

  • OpenClaw 2026.4.14 (323493f)
  • memory-core: plugins.slots.memory: "memory-core"
  • memory-wiki: plugins.entries.memory-wiki.enabled: true, vaultMode: "bridge"
  • active-memory: plugins.entries.active-memory.enabled: true
  • memory backend: qmd
  • OS: Linux (Kali), systemd service
  • Gateway: running, pid confirmed active, RPC probe ok

Workaround

Switch to vaultMode: "isolated" and use wiki_apply tool for manual knowledge entry. Bridge mode is non-functional until this is fixed.

Metadata

Metadata

Assignees

Labels

dedupe:childDuplicate issue/PR child in dedupe cluster

Type

No type

Fields

Priority

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions