fix memory wiki empty related blocks (#78399) · openclaw/openclaw@7a73b37
amknight
·
2026-05-06
·
via Recent Commits to openclaw:main
File tree
extensions/memory-wiki/src
| Original file line number | Diff line number | Diff line change |
|---|
@@ -121,6 +121,7 @@ Docs: https://docs.openclaw.ai
|
121 | 121 | - Dependencies: override transitive `ip-address` to `10.2.0` so the runtime lockfile no longer includes the vulnerable `10.1.0` build flagged by Dependabot alert 109. Thanks @vincentkoc. |
122 | 122 | - Plugins/install: apply OpenClaw's npm security overrides inside managed external plugin npm roots so hoisted plugin dependencies inherit the host package hardening. Thanks @vincentkoc. |
123 | 123 | - Feishu: hydrate missing native topic starter thread IDs before session routing so first turns and follow-ups stay in the same topic session. Fixes #78262. Thanks @joeyzenghuan. |
| 124 | +- Memory Wiki: skip empty and whitespace-only source pages when refreshing generated Related blocks, preventing blank pages from being rewritten into Related-only stubs. Fixes #78121. Thanks @amknight. |
124 | 125 | - LINE: reject `dmPolicy: "open"` configs without wildcard `allowFrom` so webhook DMs fail validation instead of being acknowledged and silently blocked before inbound processing. Fixes #78316. |
125 | 126 | - Telegram/Codex: keep message-tool-only progress drafts visible and render native Codex tool progress once per tool instead of duplicating item/tool draft lines. Fixes #75641. (#77949) Thanks @keshavbotagent. |
126 | 127 | - Providers/xAI: stop sending OpenAI-style reasoning effort controls to native Grok Responses models, so `xai/grok-4.3` no longer fails live Docker/Gateway runs with `Invalid reasoning effort`. |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -170,6 +170,24 @@ describe("compileMemoryWikiVault", () => {
|
170 | 170 | ); |
171 | 171 | }); |
172 | 172 | |
| 173 | +it("does not rewrite empty source pages into related-only stubs", async () => { |
| 174 | +const { rootDir, config } = await createVault({ |
| 175 | +rootDir: nextCaseRoot(), |
| 176 | +initialize: true, |
| 177 | +}); |
| 178 | +const emptySourcePath = path.join(rootDir, "sources", "empty.md"); |
| 179 | +const whitespaceSourcePath = path.join(rootDir, "sources", "whitespace.md"); |
| 180 | +await fs.writeFile(emptySourcePath, "", "utf8"); |
| 181 | +await fs.writeFile(whitespaceSourcePath, " \n\t", "utf8"); |
| 182 | + |
| 183 | +const result = await compileMemoryWikiVault(config); |
| 184 | + |
| 185 | +await expect(fs.readFile(emptySourcePath, "utf8")).resolves.toBe(""); |
| 186 | +await expect(fs.readFile(whitespaceSourcePath, "utf8")).resolves.toBe(" \n\t"); |
| 187 | +expect(result.updatedFiles).not.toContain(emptySourcePath); |
| 188 | +expect(result.updatedFiles).not.toContain(whitespaceSourcePath); |
| 189 | +}); |
| 190 | + |
173 | 191 | it("does not relate every page through a broad shared source", async () => { |
174 | 192 | const { rootDir, config } = await createVault({ |
175 | 193 | rootDir: nextCaseRoot(), |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -776,6 +776,9 @@ async function refreshPageRelatedBlocks(params: {
|
776 | 776 | continue; |
777 | 777 | } |
778 | 778 | const original = await root.readText(page.relativePath); |
| 779 | +if (original.trim().length === 0) { |
| 780 | +continue; |
| 781 | +} |
779 | 782 | const updated = withTrailingNewline( |
780 | 783 | replaceManagedMarkdownBlock({ |
781 | 784 | original, |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。