Skip to content

fix(wiki): register memory publicArtifacts in CLI-metadata mode#70185

Closed
prasad-yashdeep wants to merge 1 commit into
openclaw:mainfrom
prasad-yashdeep:fix/cli-bridge-import-missing-memory-artifacts
Closed

fix(wiki): register memory publicArtifacts in CLI-metadata mode#70185
prasad-yashdeep wants to merge 1 commit into
openclaw:mainfrom
prasad-yashdeep:fix/cli-bridge-import-missing-memory-artifacts

Conversation

@prasad-yashdeep

Copy link
Copy Markdown

Problem

openclaw wiki bridge import always returns 0 artifacts / 0 workspaces and destructively removes previously-synced bridge sources — even though the in-process runtime bridge works perfectly with 155+ artifacts.

Root cause

The CLI process loads plugin cli-metadata.ts entries (lightweight) instead of the full index.ts. The memory-core cli-metadata.ts only registered CLI commands and never called registerMemoryCapability(), so memoryPluginState.capability stayed empty. When the wiki bridge called listActiveMemoryPublicArtifacts(), it got nothing back.

Additionally, the CLI-metadata plugin loader in loader.ts only wired registerCli as a handler — registerMemoryCapability defaulted to a no-op, so even if the plugin tried to register, it would be silently swallowed.

Fix

Two changes:

  1. extensions/memory-core/cli-metadata.ts: Register the publicArtifacts provider (via listMemoryCorePublicArtifacts) and declare kind: "memory" so the memory slot resolution accepts it.

  2. src/plugins/loader.ts: Wire registerMemoryCapability in the CLI-metadata buildPluginApi handlers (with the same hasKind guard used in full registration) so the call actually reaches memoryPluginState.

Testing

  • All 6 bridge.test.ts tests pass ✅
  • All 105 loader.test.ts tests pass ✅
  • Zero new type errors (6 pre-existing errors in pi-embedded-runner are unrelated)

Fixes #70181

@greptile-apps

greptile-apps Bot commented Apr 22, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes openclaw wiki bridge import returning 0 artifacts in CLI-metadata mode by (1) adding kind: "memory" and a publicArtifacts registration to memory-core/cli-metadata.ts, and (2) wiring registerMemoryCapability in loader.ts's CLI-metadata buildPluginApi handlers using the same hasKind guard as the full registration path. Both changes are consistent with the existing patterns in registry.ts and memory-state.ts.

Confidence Score: 5/5

This PR is safe to merge — the fix is narrow, targeted, and consistent with the existing full-registration pattern.

Both changes mirror the existing full-registration logic exactly, all 111 tests pass, and no new type errors are introduced. No P0/P1 issues found.

No files require special attention.

Reviews (1): Last reviewed commit: "fix(wiki): register memory publicArtifac..." | Re-trigger Greptile

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

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: d030bbf985

ℹ️ 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 src/plugins/loader.ts
Comment thread src/plugins/loader.ts
`openclaw wiki bridge import` calls `listActiveMemoryPublicArtifacts` to
discover memory files across workspaces, but the CLI process only loads
plugin `cli-metadata.ts` entries — not the full `index.ts`. The
memory-core `cli-metadata.ts` only registered CLI commands and never
called `registerMemoryCapability`, so `memoryPluginState.capability`
stayed empty and bridge import always returned 0 artifacts.

Changes:

1. **`extensions/memory-core/cli-metadata.ts`**: Register the
   `publicArtifacts` provider (via `listMemoryCorePublicArtifacts`) and
   declare `kind: "memory"` so the memory slot resolution accepts it.

2. **`src/plugins/loader.ts`**: Wire `registerMemoryCapability` in the
   CLI-metadata `buildPluginApi` handlers with the same `hasKind` and
   dual-kind `memorySlotSelected` guards used in full registration.
   Also snapshot/restore memory plugin state on register failure so a
   throwing plugin cannot leak a partially-registered capability.

Fixes openclaw#70181
@prasad-yashdeep
prasad-yashdeep force-pushed the fix/cli-bridge-import-missing-memory-artifacts branch from d030bbf to 7d1358c Compare April 22, 2026 13:37
@Galexlp

Galexlp commented Apr 24, 2026

Copy link
Copy Markdown

cant wait for this to be fixed, my agents memory is messed up until wiki can work properly

@vincentkoc

Copy link
Copy Markdown
Member

ProjectClownfish could not safely update this branch, so it opened a narrow replacement PR instead.

Replacement PR: #72615
Source PR: #70185
Contributor credit is preserved in the replacement PR body and changelog plan.

@vincentkoc vincentkoc closed this Apr 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CLI wiki bridge import returns 0 artifacts while runtime bridge works correctly

3 participants