openclaw - ✅(Solved) Fix memory search still targets stale QMD collections (memory-alt-main/custom-1-main) and falls back to builtin [1 pull requests, 1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#65908Fetched 2026-04-14 05:39:41
View on GitHub
Comments
1
Participants
2
Timeline
2
Reactions
2
Timeline (top)
commented ×1cross-referenced ×1

openclaw memory search can still target stale/missing managed QMD collection names even when the live QMD config and index are healthy. When this happens, memory recall still works via builtin fallback, but the command emits noisy repair/failure output and can trip failure-only canaries.

Error Message

t-main --glob memory.md failed (code 1): A collection already exists for this path and pattern: Name: memory-root-main (qmd://memory-root-main/) Pattern: **/*.md

Use 'qmd update' to re-index it, or remove it first with 'qmd collection remove memory-root-main'

[memory] qmd collection add skipped for custom-1-main: EEXIST: file already exists, mkdir '/Users/scout/Documents/OpenClawMemory/MEMORY.md' [memory] qmd search failed because a managed collection is missing; repairing collections and retrying once [memory] qmd collection add skipped for memory-alt-main: qmd collection add /Users/scout/clawd --name memory-alt-main --glob memory.md failed (code 1): A collection already exists for this path and pattern: Name: memory-root-main (qmd://memory-root-main/) Pattern: **/*.md

Use 'qmd update' to re-index it, or remove it first with 'qmd collection remove memory-root-main'

[memory] qmd collection add skipped for custom-1-main: EEXIST: file already exists, mkdir '/Users/scout/Documents/OpenClawMemory/MEMORY.md' [memory] qmd search failed: Error: qmd search placeholder --json -n 1 -c memory-alt-main failed (code 1): Collection not found: memory-alt-main

[memory] qmd memory failed; switching to builtin index: qmd search placeholder --json -n 1 -c memory-alt-main failed (code 1): Collection not found: memory-alt-main

Root Cause

Because memory-alt-main did not exist, OpenClaw failed the QMD search, then fell back to builtin/local search and returned results anyway.

Fix Action

Fixed

PR fix notes

PR #66141: fix(memory): unify default root memory handling

Description (problem / solution / changelog)

Summary

  • treat workspace root memory as a single slot instead of separate MEMORY.md and memory.md default QMD collections
  • make QMD prefer exact MEMORY.md, fall back to legacy lowercase memory.md only when the canonical file is absent, and stop generating/searching phantom memory-alt-* collections
  • align builtin memory file discovery with the same uppercase-first fallback rule so both backends share one root-memory model
  • harden QMD upgrade/rebind logic so legacy memory-alt collections that still own the root slot can be rebound to memory-root-* during repair

Why

OpenClaw had real source-of-truth drift around default root memory handling. The workspace/bootstrap rules already treat lowercase memory.md as legacy fallback only, but the QMD default collection resolver still modeled it as a second default collection. That let runtime search and repair target phantom memory-alt-* collections when only MEMORY.md existed.

User impact

  • removes noisy phantom QMD lookups and fallback-to-builtin behavior for normal MEMORY.md workspaces
  • keeps lowercase-only legacy workspaces working
  • makes builtin and QMD root-memory behavior consistent

Validation

  • pnpm test -- packages/memory-host-sdk/src/host/internal.test.ts
  • pnpm test -- packages/memory-host-sdk/src/host/backend-config.test.ts
  • pnpm test -- extensions/memory-core/src/memory/qmd-manager.test.ts
  • commit hook passed pnpm check

Related

  • #65913
  • #65908
  • #65890

Changed files

  • CHANGELOG.md (modified, +1/-0)
  • extensions/memory-core/src/memory/qmd-manager.test.ts (modified, +165/-0)
  • extensions/memory-core/src/memory/qmd-manager.ts (modified, +73/-5)
  • packages/memory-host-sdk/src/host/backend-config.test.ts (modified, +88/-3)
  • packages/memory-host-sdk/src/host/backend-config.ts (modified, +35/-2)
  • packages/memory-host-sdk/src/host/internal.test.ts (modified, +19/-0)
  • packages/memory-host-sdk/src/host/internal.ts (modified, +25/-4)

Code Example

openclaw memory search --query "placeholder" --max-results 1

---

t-main --glob memory.md failed (code 1): A collection already exists for this path and pattern:
  Name: memory-root-main (qmd://memory-root-main/)
  Pattern: **/*.md

Use 'qmd update' to re-index it, or remove it first with 'qmd collection remove memory-root-main'

[memory] qmd collection add skipped for custom-1-main: EEXIST: file already exists, mkdir '/Users/scout/Documents/OpenClawMemory/MEMORY.md'
[memory] qmd search failed because a managed collection is missing; repairing collections and retrying once
[memory] qmd collection add skipped for memory-alt-main: qmd collection add /Users/scout/clawd --name memory-alt-main --glob memory.md failed (code 1): A collection already exists for this path and pattern:
  Name: memory-root-main (qmd://memory-root-main/)
  Pattern: **/*.md

Use 'qmd update' to re-index it, or remove it first with 'qmd collection remove memory-root-main'

[memory] qmd collection add skipped for custom-1-main: EEXIST: file already exists, mkdir '/Users/scout/Documents/OpenClawMemory/MEMORY.md'
[memory] qmd search failed: Error: qmd search placeholder --json -n 1 -c memory-alt-main failed (code 1): Collection not found: memory-alt-main

[memory] qmd memory failed; switching to builtin index: qmd search placeholder --json -n 1 -c memory-alt-main failed (code 1): Collection not found: memory-alt-main

---

memory-dir-main | /Users/scout/clawd/memory | **/*.md
custom-2-main   | /Users/scout/Documents/OpenClawMemory/memory | **/*.md
memory-root-main| /Users/scout/clawd | **/*.md

---

XDG_CONFIG_HOME=/Users/scout/.openclaw/agents/main/qmd/xdg-config \
XDG_CACHE_HOME=/Users/scout/.openclaw/agents/main/qmd/xdg-cache \
QMD_CONFIG_DIR=/Users/scout/.openclaw/agents/main/qmd/xdg-config/qmd \
qmd collection list
RAW_BUFFERClick to expand / collapse

Summary

openclaw memory search can still target stale/missing managed QMD collection names even when the live QMD config and index are healthy. When this happens, memory recall still works via builtin fallback, but the command emits noisy repair/failure output and can trip failure-only canaries.

Version

  • OpenClaw: 2026.4.11
  • Channel: stable
  • OS: macOS 26.3.1 arm64
  • Node: 22.22.0
  • Memory backend: QMD

What I expected

openclaw memory search --query "placeholder" --max-results 1 should use the currently managed QMD collections and return results without trying to create/search missing collection names.

What happened

The command tried to use stale collection names memory-alt-main and custom-1-main, even though the live QMD config contained different collections:

  • memory-dir-main
  • custom-2-main
  • memory-root-main

Because memory-alt-main did not exist, OpenClaw failed the QMD search, then fell back to builtin/local search and returned results anyway.

Repro

On a system with QMD enabled for memory, run:

openclaw memory search --query "placeholder" --max-results 1

Observed output includes:

t-main --glob memory.md failed (code 1): A collection already exists for this path and pattern:
  Name: memory-root-main (qmd://memory-root-main/)
  Pattern: **/*.md

Use 'qmd update' to re-index it, or remove it first with 'qmd collection remove memory-root-main'

[memory] qmd collection add skipped for custom-1-main: EEXIST: file already exists, mkdir '/Users/scout/Documents/OpenClawMemory/MEMORY.md'
[memory] qmd search failed because a managed collection is missing; repairing collections and retrying once
[memory] qmd collection add skipped for memory-alt-main: qmd collection add /Users/scout/clawd --name memory-alt-main --glob memory.md failed (code 1): A collection already exists for this path and pattern:
  Name: memory-root-main (qmd://memory-root-main/)
  Pattern: **/*.md

Use 'qmd update' to re-index it, or remove it first with 'qmd collection remove memory-root-main'

[memory] qmd collection add skipped for custom-1-main: EEXIST: file already exists, mkdir '/Users/scout/Documents/OpenClawMemory/MEMORY.md'
[memory] qmd search failed: Error: qmd search placeholder --json -n 1 -c memory-alt-main failed (code 1): Collection not found: memory-alt-main

[memory] qmd memory failed; switching to builtin index: qmd search placeholder --json -n 1 -c memory-alt-main failed (code 1): Collection not found: memory-alt-main

Then builtin fallback still returns a valid result.

Current live state on the affected machine

openclaw memory status / QMD state is healthy:

  • provider: qmd
  • indexed: 56 chunks
  • vector: ready

QMD collections from the active OpenClaw XDG config:

memory-dir-main | /Users/scout/clawd/memory | **/*.md
custom-2-main   | /Users/scout/Documents/OpenClawMemory/memory | **/*.md
memory-root-main| /Users/scout/clawd | **/*.md

Also confirmed directly with:

XDG_CONFIG_HOME=/Users/scout/.openclaw/agents/main/qmd/xdg-config \
XDG_CACHE_HOME=/Users/scout/.openclaw/agents/main/qmd/xdg-cache \
QMD_CONFIG_DIR=/Users/scout/.openclaw/agents/main/qmd/xdg-config/qmd \
qmd collection list

which showed the same 3 collections above, and not memory-alt-main / custom-1-main.

Likely issue

There seems to be stale managed-collection name state somewhere in the memory repair/search path. The runtime/index is healthy, but openclaw memory search still references old generated collection names and then searches one that does not exist.

There may be two related bugs here:

  1. stale collection-name bookkeeping (memory-alt-main vs live memory-root-main)
  2. custom memory path handling trying to mkdir a file path (.../OpenClawMemory/MEMORY.md) for custom-1-main

Impact

  • noisy stderr/logs
  • false-positive monitoring/canary failures
  • unnecessary fallback to builtin search even though QMD is available

Notes

Upgrading to 2026.4.11 did not resolve the issue.

extent analysis

TL;DR

The most likely fix is to clear the stale managed-collection name state and ensure openclaw memory search uses the current QMD collections.

Guidance

  • Verify the QMD collections using qmd collection list to ensure they match the live QMD config.
  • Check the OpenClaw XDG config for any stale or outdated collection names.
  • Run qmd update to re-index the collections and remove any stale state.
  • Consider removing the memory-alt-main and custom-1-main collections if they are not needed.

Example

No code snippet is provided as the issue seems to be related to configuration and state management.

Notes

The issue may be caused by a combination of stale collection-name bookkeeping and custom memory path handling. Upgrading to 2026.4.11 did not resolve the issue, so a manual fix may be required.

Recommendation

Apply a workaround by manually removing stale collections and re-indexing the QMD collections using qmd update. This should resolve the issue until a permanent fix is available.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING