fix(memory): preserve shared qmd collection names#57628
Conversation
Greptile SummaryThis PR fixes a bug in Key changes:
The change is minimal and well-scoped. No issues were found. Confidence Score: 5/5Safe to merge — targeted one-line logic change backed by comprehensive unit and integration tests, with no new permissions or network calls. The fix is narrow and correct: isPathInsideRoot handles all POSIX and Windows cross-drive edge cases via path.relative/path.resolve, the four-quadrant branching (internal/external × named/unnamed) maps cleanly onto the stated scope boundary, and both the resolver-level unit tests and the end-to-end spawn-assertion integration test lock in the new behaviour. No P0 or P1 issues were found. No files require special attention.
|
| Filename | Overview |
|---|---|
| packages/memory-host-sdk/src/host/backend-config.ts | Core fix: adds isPathInsideRoot helper and updates resolveCustomPaths to skip agent-scoping when a path entry has an explicit name and lives outside the workspace. Logic is correct across all four cases. |
| packages/memory-host-sdk/src/host/backend-config.test.ts | Two new unit tests: one verifying explicit external named paths produce verbatim collection names for all agents, one confirming unnamed extraPaths entries remain agent-scoped even when outside the workspace. |
| extensions/memory-core/src/memory/qmd-manager.test.ts | Integration test added verifying the QMD spawn call uses -c notion-mirror verbatim, covering the full path from config resolution through search invocation. |
| CHANGELOG.md | Entry added to current beta section describing the fix and crediting contributors. No issues. |
Reviews (1): Last reviewed commit: "Merge branch 'main' into fix/qmd-binary-..." | Re-trigger Greptile
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d1dc7dbfbc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
* fix(memory): preserve shared qmd collection names * fix(memory): canonicalize qmd path containment
* fix(memory): preserve shared qmd collection names * fix(memory): canonicalize qmd path containment
* fix(memory): preserve shared qmd collection names * fix(memory): canonicalize qmd path containment
* fix(memory): preserve shared qmd collection names * fix(memory): canonicalize qmd path containment
* fix(memory): preserve shared qmd collection names * fix(memory): canonicalize qmd path containment
* fix(memory): preserve shared qmd collection names * fix(memory): canonicalize qmd path containment
* fix(memory): preserve shared qmd collection names * fix(memory): canonicalize qmd path containment
Summary
memory.qmd.paths[*].namecollections with-<agentId>, so shared external QMD collections likenotion-mirrorwere queried asnotion-mirror-mainand missed entirely.memory_searchcould not hit externally managed shared QMD collections even when users configured the correct collection name.memorySearch.extraPathsstill keep current agent scoping.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Root Cause / Regression History (if applicable)
packages/memory-host-sdk/src/host/backend-config.tsran custommemory.qmd.paths[*].nameentries through the samescopeCollectionBase(...)path as OpenClaw-owned collections, so the configured external collection identity was rewritten before search execution.git blame, prior PR, issue, or refactor if known): the current behavior lives in the post-refactor SDK host resolver path.Regression Test Plan (if applicable)
packages/memory-host-sdk/src/host/backend-config.test.ts,extensions/memory-core/src/memory/qmd-manager.test.tsUser-visible / Behavior Changes
memory.qmd.paths[*]entries that point outside the agent workspace now keep their configured collection name instead of gaining-<agentId>.Diagram (if applicable)
Security Impact (required)
Yes, explain risk + mitigation:Repro + Verification
Environment
memory.backend=qmd, explicitmemory.qmd.paths[*].name, path outside workspaceSteps
memory.backend=qmdwith an explicit named custom path outside the agent workspace, for examplename: notion-mirror.memory_searchfrom an agent using that QMD backend.Expected
notion-mirrorexactly.Actual
notion-mirror-mainand missed the real shared collection.Evidence
Human Verification (required)
notion-mirrorverbatim.Review Conversations
Compatibility / Migration
Risks and Mitigations