fix(memory): warn on unverified qmd conflict · openclaw/openclaw@c39f858
MonkeyLeeT
·
2026-05-09
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -1049,7 +1049,7 @@ describe("QmdMemoryManager", () => {
|
1049 | 1049 | ); |
1050 | 1050 | }); |
1051 | 1051 | |
1052 | | -it("refuses to rebind a stderr-only path-pattern conflict without collection metadata", async () => { |
| 1052 | +it("surfaces a manual repair hint for stderr-only path-pattern conflicts", async () => { |
1053 | 1053 | cfg = { |
1054 | 1054 | ...cfg, |
1055 | 1055 | memory: { |
@@ -1114,6 +1114,14 @@ describe("QmdMemoryManager", () => {
|
1114 | 1114 | expect(removeCalls).toEqual([]); |
1115 | 1115 | expect(addCalls).toEqual(["workspace-main"]); |
1116 | 1116 | expect(logWarnMock).not.toHaveBeenCalledWith(expect.stringContaining("rebinding")); |
| 1117 | +expect(logWarnMock).toHaveBeenCalledWith( |
| 1118 | +expect.stringContaining( |
| 1119 | +"qmd reported existing collection workspace-legacy, but list output did not include verifiable path/pattern metadata", |
| 1120 | +), |
| 1121 | +); |
| 1122 | +expect(logWarnMock).toHaveBeenCalledWith( |
| 1123 | +expect.stringContaining("qmd collection remove workspace-legacy"), |
| 1124 | +); |
1117 | 1125 | expect(logWarnMock).toHaveBeenCalledWith( |
1118 | 1126 | expect.stringContaining("qmd collection add skipped for workspace-main"), |
1119 | 1127 | ); |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -673,23 +673,11 @@ export class QmdMemoryManager implements MemorySearchManager {
|
673 | 673 | |
674 | 674 | if (!conflictName) { |
675 | 675 | const parsedConflictName = this.parseConflictingCollectionNameFromAddError(addErrorMessage); |
676 | | -const parsedDetails = parsedConflictName ? existing.get(parsedConflictName) : undefined; |
677 | | -if ( |
678 | | -parsedConflictName && |
679 | | -parsedDetails?.path && |
680 | | -typeof parsedDetails.pattern === "string" && |
681 | | -this.pathsMatch(parsedDetails.path, collection.path) && |
682 | | -this.patternsMatchForManagedCollection( |
683 | | -collection.path, |
684 | | -parsedDetails.pattern, |
685 | | -collection.pattern, |
686 | | -) |
687 | | -) { |
688 | | -conflictName = parsedConflictName; |
| 676 | +if (parsedConflictName) { |
| 677 | +log.warn( |
| 678 | +`qmd collection add conflict for ${collection.name}: qmd reported existing collection ${parsedConflictName}, but list output did not include verifiable path/pattern metadata; refusing automatic rebind. If ${parsedConflictName} is stale, remove it manually with 'qmd collection remove ${parsedConflictName}'`, |
| 679 | +); |
689 | 680 | } |
690 | | -} |
691 | | - |
692 | | -if (!conflictName) { |
693 | 681 | return false; |
694 | 682 | } |
695 | 683 | if (conflictName === collection.name) { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。