fix(memory-wiki): skip bridge pruning when memory-core is not loaded … · openclaw/openclaw@7f57895
mara-mindles
·
2026-04-26
·
via Recent Commits to openclaw:main
File tree
extensions/memory-wiki/src
| Original file line number | Diff line number | Diff line change |
|---|
@@ -2,6 +2,7 @@ import { createHash } from "node:crypto";
|
2 | 2 | import fs from "node:fs/promises"; |
3 | 3 | import path from "node:path"; |
4 | 4 | import { |
| 5 | +getMemoryCapabilityRegistration, |
5 | 6 | listActiveMemoryPublicArtifacts, |
6 | 7 | type MemoryPluginPublicArtifact, |
7 | 8 | } from "openclaw/plugin-sdk/memory-host-core"; |
@@ -248,12 +249,17 @@ export async function syncMemoryWikiBridgeSources(params: {
|
248 | 249 | } |
249 | 250 | const workspaceCount = new Set(publicArtifacts.map((artifact) => artifact.workspaceDir)).size; |
250 | 251 | |
251 | | -const removedCount = await pruneImportedSourceEntries({ |
252 | | -vaultRoot: params.config.vault.path, |
253 | | -group: "bridge", |
254 | | - activeKeys, |
255 | | - state, |
256 | | -}); |
| 252 | +// Skip pruning when memory-core is not loaded (e.g. CLI context) to avoid |
| 253 | +// removing all bridge-imported entries. See #68373. |
| 254 | +const memoryCapability = getMemoryCapabilityRegistration(); |
| 255 | +const removedCount = memoryCapability |
| 256 | + ? await pruneImportedSourceEntries({ |
| 257 | +vaultRoot: params.config.vault.path, |
| 258 | +group: "bridge", |
| 259 | + activeKeys, |
| 260 | + state, |
| 261 | +}) |
| 262 | + : 0; |
257 | 263 | await writeMemoryWikiSourceSyncState(params.config.vault.path, state); |
258 | 264 | const importedCount = results.filter((result) => result.changed && result.created).length; |
259 | 265 | const updatedCount = results.filter((result) => result.changed && !result.created).length; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -20,6 +20,7 @@ export { emptyPluginConfigSchema } from "../plugins/config-schema.js";
|
20 | 20 | export { |
21 | 21 | buildMemoryPromptSection as buildActiveMemoryPromptSection, |
22 | 22 | listActiveMemoryPublicArtifacts, |
| 23 | +getMemoryCapabilityRegistration, |
23 | 24 | } from "../plugins/memory-state.js"; |
24 | 25 | export { parseAgentSessionKey } from "../routing/session-key.js"; |
25 | 26 | export type { OpenClawConfig } from "../config/config.js"; |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。