-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
memory(qmd): collections never rebind when a collection's root path changes #91251
Copy link
Copy link
Closed
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.ClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Description
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.ClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Type
Fields
Priority
None yet
Summary
MemoryQmdManager.ensureCollections()is meant to rebind a managed qmd collection (remove + re-add) when its filesystem root changes — for example when an agent'sworkspaceis repointed. The rebind never fires, so collections stay pinned to the stale root after a workspace move.Root cause
The rebind decision in
shouldRebindCollection(collection, listed)compareslisted.pathagainst the desired collection path. Butlisted.pathis alwaysundefined:listCollectionsBestEffort()readsqmd collection list, whose output carries no filesystem path (only name / pattern / counts).listed.pathundefined,shouldRebindCollectiontakes its defensive "incomplete metadata" branch and returnsfalse→ no rebind.So a configured workspace move is invisible to the engine: memory reads keep resolving the old location while the agent writes to the new one.
qmd collection show <name>does expose the path:Reproduction
workspaceto B (same content).memory index --force.store_collectionsstill reference A; recall resolves A, not B.Proposed fix
Enrich
listCollectionsBestEffort()with each managed collection'spathviaqmd collection show <name>, soshouldRebindCollectioncan detect a changed root and rebind. (PR incoming.)