Skip to content

[Regression v2026.4.15] Cached plugin restore drops memory capability, breaks wiki bridge imports #68373

Description

@RoseKongPS

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

After upgrading to v2026.4.15, openclaw wiki status reports "Bridge: enabled (0 exported artifacts)" and openclaw wiki bridge import returns 0 artifacts across 0 workspaces, despite memory-core plugin being active and MEMORY.md + memory/*.md files existing in the workspace. Debug logging confirmed that registerMemoryCapability correctly sets publicArtifacts, but subsequent restoreMemoryPluginState calls from the plugin cache (150+ calls per restart) overwrite the capability with undefined because the cached state snapshot was taken before capability registration.

Steps to reproduce

  1. Install OpenClaw v2026.4.15 via npm global.
  2. Enable memory-wiki bridge mode in openclaw.json:
    • plugins.entries.memory-wiki.config.vaultMode: "bridge"
    • plugins.entries.memory-wiki.config.bridge.enabled: true
  3. Ensure memory-core is the active memory slot (slots.memory = "memory-core") with existing MEMORY.md and memory/*.md daily note files.
  4. Restart gateway: openclaw gateway restart
  5. Run openclaw wiki status or openclaw wiki bridge import.
  6. Observe: 0 exported artifacts, bridge import returns 0 artifacts across 0 workspaces.
  7. Debug logging in memory-state-B-M2UC51.js confirms register succeeds, then 150+ RESTORE calls overwrite capability to undefined.

Expected behavior

Bridge reports exported artifacts from memory-core's publicArtifacts (MEMORY.md, daily notes under memory/.md, dream reports under memory/dreaming/). This worked in v2026.4.12 after Issue #63157 was fixed.

Actual behavior

wiki_status reports: "Bridge: enabled (0 exported artifacts)" with warning "active memory plugin is not exporting any public memory artifacts yet". wiki bridge import returns artifactCount: 0, workspaceCount: 0. Debug logging in memory-state-B-M2UC51.js shows the sequence:

  1. clearMemoryPluginState() — clears capability
  2. registerMemoryCapability('memory-core', {...}) — correctly writes capability with publicArtifacts
  3. restoreMemoryPluginState(state) × 150+ — each call receives state.capability = undefined from the cached snapshot (which was saved after CLEAR but before register), unconditionally overwriting the registered capability to void 0

The relevant code in restoreMemoryPluginState:

memoryPluginState.capability = state.capability ? {
  pluginId: state.capability.pluginId,
  capability: { ...state.capability.capability }
} : void 0;

When state.capability is undefined (from cached post-CLEAR state), this wipes the capability that registerMemoryCapability just set.

OpenClaw version

2026.4.15 (041266a)

Operating system

macOS Sequoia 15.4 (arm64)

Install method

npm global

Model

N/A (plugin cache issue, model-independent)

Provider / routing chain

N/A (plugin cache issue, provider-independent)

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Debug logging added to `memory-state-B-M2UC51.js` (register, clear, restore, list functions) confirmed the race condition. Key evidence from `gateway.err.log`:


[DEBUG-MEMORY] CLEAR called, instance: 8tvacg2vdzw had capability: false
[DEBUG-MEMORY] register instance: 8tvacg2vdzw plugin: memory-core keys: [ 'promptBuilder', 'flushPlanResolver', 'runtime', 'publicArtifacts' ]
[DEBUG-MEMORY] RESTORE called, instance: 8tvacg2vdzw has capability in state: false
... (×150+)
[DEBUG-MEMORY] list instance: 8tvacg2vdzw capability: false pluginId: undefined


`wiki_status` output:

Vault status: bridge mode configured but bridge.enabled=false
0 source/entity/concept/synthesis pages, 5 reports
Warning: active memory plugin is not exporting any public memory artifacts yet

Impact and severity

Affected: All users running v2026.4.15 with memory-core + memory-wiki bridge mode enabled.
Severity: High — completely blocks wiki bridge import, making the bridge feature non-functional.
Frequency: Always — reproduces on every gateway restart (150+ RESTORE calls per restart).
Consequence: Wiki bridge cannot import memory artifacts, making bridge mode useless. Users relying on wiki for knowledge management are blocked.

Additional information

Last known good version: v2026.4.12 (Issue #63157 fixed the same bug).
First known bad version: v2026.4.15.

The v2026.4.15 changelog mentions "Plugin Packaging Refinements — Localized bundled plugin runtime dependencies to their owning extensions and trimmed the published payload." This refactoring likely re-introduced the cache serialization gap where memoryPluginState.capability is not persisted in the plugin registry cache.

Suggested fix: restoreMemoryPluginState should preserve an already-registered capability when the cached state lacks one. Specifically, add a guard:

if (state.capability) {
  memoryPluginState.capability = {
    pluginId: state.capability.pluginId,
    capability: { ...state.capability.capability }
  };
}
// else: keep existing registered capability (don't overwrite with undefined)

Alternatively, ensure the cache save path includes memoryCapability: getMemoryCapabilityRegistration() before the CLEAR step.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions