Skip to content

Align QMD memory reads with canonical memory paths#66026

Merged
drobison00 merged 4 commits into
openclaw:mainfrom
eleqtrizit:fix/memory-read-path
Apr 14, 2026
Merged

Align QMD memory reads with canonical memory paths#66026
drobison00 merged 4 commits into
openclaw:mainfrom
eleqtrizit:fix/memory-read-path

Conversation

@eleqtrizit

@eleqtrizit eleqtrizit commented Apr 13, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Aligns QMD-backed memory_get reads with the canonical memory-file contract
  • Keeps qmd/<collection>/... reads unchanged while rejecting plain workspace markdown paths outside the default memory set unless they are exact active indexed QMD workspace docs

Changes

  • Added a canonical memory-path guard in extensions/memory-core/src/memory/qmd-manager.ts for non-qmd/ reads
  • Preserved search-to-read round trips for exact indexed workspace paths returned by QMD search
  • Added lowercase dreams.md parity to the canonical memory allowlist
  • Updated extensions/memory-core/src/memory/qmd-manager.test.ts to reject non-memory workspace markdown reads and to keep canonical memory-file line-range reads covered

Validation

  • Ran corepack pnpm test extensions/memory-core/src/memory/qmd-manager.test.ts extensions/memory-core/src/memory/qmd-manager.slugified-paths.test.ts extensions/memory-core/src/memory/manager.read-file.test.ts
  • Attempted local agentic review with timeout 20s claude -p "/review", but it produced no output and exited with code 124 in this environment

Notes

  • An earlier private fix PR informed the implementation; the incorporated change is credited in the commit trailer
  • The repo-wide commit hook hit unrelated existing pnpm tsgo failures outside this change set, so the final commit used the repo's fast-commit path after the targeted validation above

@openclaw-barnacle openclaw-barnacle Bot added extensions: memory-core Extension: memory-core size: S maintainer Maintainer-authored PR labels Apr 13, 2026
@greptile-apps

greptile-apps Bot commented Apr 13, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR tightens QmdMemoryManager.readFile to only allow reads of canonical memory paths (MEMORY.md, memory.md, DREAMS.md, dreams.md, memory/*) or paths that are actively indexed in the QMD database. The guard is implemented via the new isDefaultMemoryPath helper and isIndexedWorkspaceReadPath, which queries the SQLite index. dreams.md (lowercase) was added to the allowlist to address a prior reviewer comment, and new tests cover both the rejection and the indexed-path round-trip cases.

Confidence Score: 5/5

Safe to merge — the path guard logic is correct, fail-closed, and well tested.

All three commits implement the guard correctly: canonical paths accepted by isDefaultMemoryPath, actively-indexed workspace paths accepted by isIndexedWorkspaceReadPath, everything else rejected. SQLITE_BUSY errors propagate; other DB errors fail closed. The fallback full-table scan matches the existing codebase pattern at line 2093 and only runs for slugified-path edge cases. dreams.md parity addresses the prior review comment. No P0 or P1 findings.

No files require special attention.

Reviews (4): Last reviewed commit: "fix(memory): tighten qmd read-path guard..." | Re-trigger Greptile

Comment thread USER.md Outdated
Comment thread extensions/memory-core/src/memory/qmd-manager.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 61d60eff14

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread extensions/memory-core/src/memory/qmd-manager.ts Outdated
@eleqtrizit eleqtrizit force-pushed the fix/memory-read-path branch from 80ee12a to bfa3ba5 Compare April 13, 2026 15:49

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bfa3ba5206

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread extensions/memory-core/src/memory/qmd-manager.ts
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@eleqtrizit

Copy link
Copy Markdown
Contributor Author

@greptile review

@drobison00 drobison00 force-pushed the fix/memory-read-path branch from 679f2b7 to 9ceffc5 Compare April 14, 2026 15:39
@drobison00 drobison00 merged commit 37d5971 into openclaw:main Apr 14, 2026
37 of 41 checks passed
kvnkho pushed a commit to kvnkho/openclaw that referenced this pull request Apr 17, 2026
* fix(memory): align qmd read paths

Co-authored-by: zsx <git@zsxsoft.com>

* fix(memory): add qmd exact-path read fast path

* fix(memory): tighten qmd read-path guards

* changelog: note QMD memory_get canonical-path restriction (openclaw#66026)

---------

Co-authored-by: zsx <git@zsxsoft.com>
Co-authored-by: Devin Robison <drobison@nvidia.com>
lovewanwan pushed a commit to lovewanwan/openclaw that referenced this pull request Apr 28, 2026
* fix(memory): align qmd read paths

Co-authored-by: zsx <git@zsxsoft.com>

* fix(memory): add qmd exact-path read fast path

* fix(memory): tighten qmd read-path guards

* changelog: note QMD memory_get canonical-path restriction (openclaw#66026)

---------

Co-authored-by: zsx <git@zsxsoft.com>
Co-authored-by: Devin Robison <drobison@nvidia.com>
ogt-redknie pushed a commit to ogt-redknie/OPENX that referenced this pull request May 2, 2026
* fix(memory): align qmd read paths

Co-authored-by: zsx <git@zsxsoft.com>

* fix(memory): add qmd exact-path read fast path

* fix(memory): tighten qmd read-path guards

* changelog: note QMD memory_get canonical-path restriction (openclaw#66026)

---------

Co-authored-by: zsx <git@zsxsoft.com>
Co-authored-by: Devin Robison <drobison@nvidia.com>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 9, 2026
* fix(memory): align qmd read paths

Co-authored-by: zsx <git@zsxsoft.com>

* fix(memory): add qmd exact-path read fast path

* fix(memory): tighten qmd read-path guards

* changelog: note QMD memory_get canonical-path restriction (openclaw#66026)

---------

Co-authored-by: zsx <git@zsxsoft.com>
Co-authored-by: Devin Robison <drobison@nvidia.com>
globalcaos pushed a commit to globalcaos/tinkerclaw that referenced this pull request May 13, 2026
* fix(memory): align qmd read paths

Co-authored-by: zsx <git@zsxsoft.com>

* fix(memory): add qmd exact-path read fast path

* fix(memory): tighten qmd read-path guards

* changelog: note QMD memory_get canonical-path restriction (openclaw#66026)

---------

Co-authored-by: zsx <git@zsxsoft.com>
Co-authored-by: Devin Robison <drobison@nvidia.com>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 24, 2026
* fix(memory): align qmd read paths

Co-authored-by: zsx <git@zsxsoft.com>

* fix(memory): add qmd exact-path read fast path

* fix(memory): tighten qmd read-path guards

* changelog: note QMD memory_get canonical-path restriction (openclaw#66026)

---------

Co-authored-by: zsx <git@zsxsoft.com>
Co-authored-by: Devin Robison <drobison@nvidia.com>
jameslcowan pushed a commit to jameslcowan/openclaw that referenced this pull request Jun 2, 2026
* fix(memory): align qmd read paths

Co-authored-by: zsx <git@zsxsoft.com>

* fix(memory): add qmd exact-path read fast path

* fix(memory): tighten qmd read-path guards

* changelog: note QMD memory_get canonical-path restriction (openclaw#66026)

---------

Co-authored-by: zsx <git@zsxsoft.com>
Co-authored-by: Devin Robison <drobison@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: memory-core Extension: memory-core maintainer Maintainer-authored PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants