-
-
Notifications
You must be signed in to change notification settings - Fork 57.4k
Closed
Labels
staleMarked as stale due to inactivityMarked as stale due to inactivity
Description
Bug Description
When multiple agents (sonnet, opus, haiku) share the same workspace, ensureCollections() fails to create agent-scoped collections (e.g., memory-root-opus) because another agent's collection (e.g., memory-root-sonnet) already occupies the same path + pattern slot in the qmd database.
Root Cause
In qmd-manager, ensureCollections() calls addCollection() which runs:
qmd collection add <path> --name memory-root-opus --mask MEMORY.md
qmd CLI rejects this with:
A collection already exists for this path and pattern:
Name: memory-root-sonnet (qmd://memory-root-sonnet/)
Pattern: MEMORY.md
The error handler isCollectionAlreadyExistsError() checks for "already exists" in the message and returns true, causing the code to continue — treating it as if memory-root-opus was successfully created. But it was not.
Impact
- Agent-scoped memory collections are never created for agents that start after the first one
memory_searchfails with "Collection not found" for those agentsopenclaw statusreports "vector ready" while semantic search is completely broken
Suggested Fix
isCollectionAlreadyExistsError() should distinguish between:
- Same name exists (truly OK to skip) — check if
messagecontains the exact collection name being created - Same path+pattern exists under a different name (NOT OK) — should remove the conflicting collection first, then retry
Environment
- OpenClaw 2026.2.21-2, macOS, 3 agents (sonnet/opus/haiku)
- qmd with per-agent XDG_CONFIG_HOME/XDG_CACHE_HOME isolation
- Each agent gets its own SQLite DB at
~/.openclaw/agents/{agentId}/qmd/xdg-cache/qmd/index.sqlite
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
staleMarked as stale due to inactivityMarked as stale due to inactivity