openclaw - ✅(Solved) Fix [Bug]: Memory Dreaming logs warning when qmd collection already exists (`memory-root-writer` / `memory-alt-writer`) [3 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

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#61848Fetched 2026-04-08 02:53:36
View on GitHub
Comments
0
Participants
1
Timeline
10
Reactions
0
Author
Participants
Timeline (top)
referenced ×4cross-referenced ×3labeled ×2subscribed ×1

When Memory Dreaming is enabled, OpenClaw may log a warning during memory collection registration if the target QMD collection already exists.

This appears to happen during startup or memory initialization when the system tries to run qmd collection add ... --name <existing-name> ... again for a collection that was already created previously.

The current behavior produces a warning like:

qmd collection add ... failed (code 1): Collection 'memory-root-writer' already exists.

This looks like an idempotency bug in the registration flow. Re-registering an existing collection should either:

  • be treated as success, or
  • be skipped after an existence check

At the moment, it creates noisy warnings even though the collection may already be usable.

Error Message

  • treat the “already exists” response as a non-error success path warn memory {"subsystem":"memory"} qmd collection add skipped for memory-root-writer: qmd collection add /Users/sompisjunsui/.openclaw/workspace --name memory-root-writer --glob MEMORY.md failed (code 1): Collection 'memory-root-writer' already exists. Use a different name with --name <name> 11:19:46+00:00 warn memory {"subsystem":"memory"} qmd collection add skipped for memory-root-writer: qmd collection add /Users/sompisjunsui/.openclaw/workspace --name memory-root-writer --glob MEMORY.md failed (code 1): Collection 'memory-root-writer' already exists.
  • can obscure real memory initialization failures because “already exists” is reported like an error path

Root Cause

Additional note:

  • This does not necessarily appear to break retrieval immediately.
  • It looks like a benign-but-wrong warning caused by non-idempotent collection registration.

PR fix notes

PR #62019: fix(memory): downgrade qmd collection already-exists warning to info

Description (problem / solution / changelog)

Summary

  • When listCollectionsBestEffort() returns incomplete data, ensureCollections() tries to re-add existing QMD collections
  • The "already exists" response is benign (collection is usable), but was logged at warn level
  • This creates noisy output on every gateway restart that confuses operators and masks real memory initialization errors
  • Downgrade to log.info with a concise "(already registered)" message

Closes #61848

Changes

FileChange
extensions/memory-core/src/memory/qmd-manager.ts:455log.warnlog.info, simplified message
extensions/memory-core/src/memory/qmd-manager.test.tsUpdated test to assert logInfoMock instead of logWarnMock

Test plan

  • Updated existing test assertion from logWarnMock to logInfoMock
  • CI: pnpm test extensions/memory-core

Changed files

  • extensions/memory-core/src/memory/qmd-manager.test.ts (modified, +2/-2)
  • extensions/memory-core/src/memory/qmd-manager.ts (modified, +1/-1)

PR #62443: fix(memory-core): reduce spurious qmd collection add warnings

Description (problem / solution / changelog)

Summary

When qmd collection add returns "already exists" and the collection was already in the initial listing, log as info instead of warn. The collection is already registered and usable — the warning was misleading.

Root Cause

In ensureCollections(), when qmd collection add fails with "already exists" and tryRebindConflictingCollection cannot find a conflict by path+pattern, the code logged a warning even though the collection might already be registered. On every restart or config reload, this produced noisy qmd collection add skipped for memory-root-writer warnings even when the collection was functioning correctly.

Fix

In qmd-manager.ts, distinguish two cases after tryRebindConflictingCollection returns false:

  • Collection was already listed (wasListed = true): log info — collection is registered, no action needed
  • Collection was not listed (wasListed = false): keep logging warn — genuine conflict case

Changes

  • extensions/memory-core/src/memory/qmd-manager.ts: log info (not warn) when collection was already registered
  • extensions/memory-core/src/memory/qmd-manager.test.ts: add test for info-level logging path
  • CHANGELOG.md: note the fix

Testing

Added a new unit test that mocks collection list returning the collection with full path+pattern metadata and collection add failing with "already exists", then asserts logInfo is called (not logWarn).

Fixes

Fixes: #61848

Changed files

  • CHANGELOG.md (modified, +1/-0)
  • extensions/memory-core/src/memory/qmd-manager.test.ts (modified, +47/-0)
  • extensions/memory-core/src/memory/qmd-manager.ts (modified, +8/-1)
  • ui/src/styles/dreams.css (modified, +29/-1)
  • ui/src/ui/views/dreaming.ts (modified, +3/-8)

PR #62843: fix(memory-core): reduce spurious qmd collection add warnings

Description (problem / solution / changelog)

Summary

When qmd collection add returns "already exists" and the collection was already in the initial listing, log as info instead of warn. The collection is already registered and usable — the warning was misleading.

Root Cause

In ensureCollections(), when qmd collection add fails with "already exists" and tryRebindConflictingCollection cannot find a conflict by path+pattern, the code logged a warning even though the collection was already listed. On every restart or config reload, this produced noisy qmd collection add skipped for memory-root-writer warnings even when the collection was functioning correctly.

Fix

In qmd-manager.ts, distinguish two cases after tryRebindConflictingCollection returns false:

  • Collection was already listed (wasListed = true): log info — collection is registered, no action needed
  • Collection was not listed (wasListed = false): keep logging warn — genuine conflict case

Changes

  • extensions/memory-core/src/memory/qmd-manager.ts: log info (not warn) when collection was already registered
  • extensions/memory-core/src/memory/qmd-manager.test.ts: add test for info-level logging path
  • CHANGELOG.md: note the fix

Testing

Added a new unit test that mocks collection list returning the collection with full path+pattern metadata and collection add failing with "already exists", then asserts logInfo is called (not logWarn).

Fixes

Fixes: #61848

Changed files

  • CHANGELOG.md (modified, +1/-0)
  • extensions/memory-core/src/memory/qmd-manager.test.ts (modified, +47/-0)
  • extensions/memory-core/src/memory/qmd-manager.ts (modified, +8/-1)

Code Example

Observed warning:


11:19:46+00:00 warn memory {"subsystem":"memory"} qmd collection add skipped for memory-root-writer: qmd collection add /Users/sompisjunsui/.openclaw/workspace --name memory-root-writer --glob MEMORY.md failed (code 1): Collection 'memory-root-writer' already exists.
Use a different name with --name <name>


Additional note:
- This does not necessarily appear to break retrieval immediately.
- It looks like a benign-but-wrong warning caused by non-idempotent collection registration.
RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

When Memory Dreaming is enabled, OpenClaw may log a warning during memory collection registration if the target QMD collection already exists.

This appears to happen during startup or memory initialization when the system tries to run qmd collection add ... --name <existing-name> ... again for a collection that was already created previously.

The current behavior produces a warning like:

qmd collection add ... failed (code 1): Collection 'memory-root-writer' already exists.

This looks like an idempotency bug in the registration flow. Re-registering an existing collection should either:

  • be treated as success, or
  • be skipped after an existence check

At the moment, it creates noisy warnings even though the collection may already be usable.

Steps to reproduce

  1. Enable Memory Dreaming / memory registration that uses QMD-backed collections.
  2. Start OpenClaw once so the memory collection is created successfully.
  3. Restart OpenClaw, reload config, or trigger the same memory-registration flow again.
  4. Observe logs during memory initialization.

Expected behavior

If the QMD collection already exists, the registration flow should be idempotent:

  • either detect the existing collection before calling qmd collection add, or
  • treat the “already exists” response as a non-error success path

No warning should be emitted for this case.

Actual behavior

OpenClaw runs qmd collection add again with an existing collection name and logs a warning similar to:

warn memory {"subsystem":"memory"} qmd collection add skipped for memory-root-writer: qmd collection add /Users/sompisjunsui/.openclaw/workspace --name memory-root-writer --glob MEMORY.md failed (code 1): Collection 'memory-root-writer' already exists. Use a different name with --name <name>

OpenClaw version

2026.4.5

Operating system

macOS 26.4

Install method

npm

Model

openai-codex/gpt-5.4

Provider / routing chain

openclaw->openai-codex/gpt-5.4

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Observed warning:


11:19:46+00:00 warn memory {"subsystem":"memory"} qmd collection add skipped for memory-root-writer: qmd collection add /Users/sompisjunsui/.openclaw/workspace --name memory-root-writer --glob MEMORY.md failed (code 1): Collection 'memory-root-writer' already exists.
Use a different name with --name <name>


Additional note:
- This does not necessarily appear to break retrieval immediately.
- It looks like a benign-but-wrong warning caused by non-idempotent collection registration.

Impact and severity

Severity: Low to Medium

Impact:

  • creates confusing warning noise in logs
  • makes Memory Dreaming look unhealthy even when the collection already exists and may still function
  • can obscure real memory initialization failures because “already exists” is reported like an error path
  • suggests the registration flow is not idempotent, which may cause repeated operator confusion on every restart/reload

Additional information

Environment

  • OpenClaw version: 2026.4.5
  • Host OS: macOS 26.4 (Darwin)
  • Memory feature: Memory Dreaming enabled
  • QMD-backed memory collections involved:
    • memory-root-writer
    • possibly memory-alt-writer as well, depending on setup

extent analysis

TL;DR

To fix the idempotency bug in the registration flow, modify the qmd collection add command to check if the collection already exists before attempting to add it, and treat the "already exists" response as a non-error success path.

Guidance

  • Before running qmd collection add, perform an existence check using a command like qmd collection list to see if the collection already exists.
  • If the collection exists, skip the qmd collection add command and proceed with the rest of the registration flow.
  • Consider modifying the warning message to indicate that the collection already exists, but do not treat it as an error.
  • Review the registration flow to ensure that it is idempotent and can be safely repeated without causing issues.

Example

# Example existence check using qmd collection list
if ! qmd collection list | grep -q "memory-root-writer"; then
  qmd collection add /Users/sompisjunsui/.openclaw/workspace --name memory-root-writer --glob MEMORY.md
fi

Notes

  • The provided solution assumes that the qmd collection list command can be used to check if a collection exists.
  • The existence check may need to be modified depending on the specific requirements of the registration flow.
  • It is essential to test the modified registration flow to ensure that it is idempotent and does not cause any issues.

Recommendation

Apply workaround: Modify the registration flow to check for existing collections and treat "already exists" responses as non-error success paths. This will prevent confusing warning noise in logs and make the Memory Dreaming feature appear healthier.

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…

FAQ

Expected behavior

If the QMD collection already exists, the registration flow should be idempotent:

  • either detect the existing collection before calling qmd collection add, or
  • treat the “already exists” response as a non-error success path

No warning should be emitted for this case.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING