Repository navigation
Description
Bug type
Behavior bug (incorrect output/state without crash)
Beta release blocker
No
Summary
Body:
Environment: OpenClaw 2026.6.5 (5181e4f), Windows 11, Node v24.14.1, @tobilu/qmd (npm global install)
Workaround: Set memory.backend = "builtin".
Notes: QMD's bin/qmd ships only as a shebang script with no .cmd/.ps1 Windows wrapper in node_modules/@tobilu/qmd/bin/, which compounds the issue — even if path resolution were fixed, direct node invocation of that file would still fail on the shebang line.
Steps to reproduce
Install OpenClaw 2026.6.5 on Windows 11, with @tobilu/qmd installed globally via npm.
In openclaw.json, set memory.backend to "qmd" and configure memory.qmd.command as the absolute path to qmd.js (or qmd.cmd), with one or more paths entries pointing to local markdown vaults.
Restart the OpenClaw gateway.
Run openclaw memory status — note the index shows 0/N files indexed.
Run openclaw memory index --force or openclaw memory search "".
Observe the error in the gateway log — the configured command path is mangled (separators stripped, concatenated with the workspace path) and the module cannot be found.
Repeat steps 2–6 with command set to the qmd.cmd wrapper instead of qmd.js — same mangling occurs.
Repeat with command omitted entirely — OpenClaw falls back to invoking node_modules/@tobilu/qmd/bin/qmd directly via node, which fails with a SyntaxError on the file's shebang line.
Separately, confirm qmd search "" run directly from PowerShell (with $env:XDG_CACHE_HOME set appropriately) returns correct results — confirming QMD itself is functional and the bug is isolated to OpenClaw's invocation.
Config:
json"memory": {
"backend": "qmd",
"qmd": {
"command": "C:\Users\\AppData\Roaming\npm\node_modules\@tobilu\qmd\dist\cli\qmd.js",
"paths": [
{ "name": "vault-1", "path": "G:\My Drive\Vault One", "pattern": "/*.md" },
{ "name": "vault-2", "path": "G:\My Drive\Vault Two", "pattern": "/*.md" }
]
}
}
Expected behavior
Expected: OpenClaw spawns qmd using the configured command path and indexes the configured collections.
Actual: Every QMD invocation fails with a mangled path — backslashes stripped and the path concatenated with the workspace directory:
Error: Cannot find module 'C:\Users<user>.openclaw\workspace\UsersAppDataRoamingnpmnode_modules@tobiluqmddistcliqmd.js'
The intended path was C:\Users<user>\AppData\Roaming\npm\node_modules@tobilu\qmd\dist\cli\qmd.js. The command value appears to be treated as relative to workspace and joined without path separators, rather than recognised as an absolute Windows path.
Confirmed: QMD itself works fine. qmd search "..." from the command line (with $env:XDG_CACHE_HOME set to the existing index) returns correct JSON results. This is purely an OpenClaw invocation/path-resolution bug, not a QMD problem.
Things tried:
.js path as above — mangled as shown.
npm's auto-generated qmd.cmd wrapper as command — same mangling pattern, plus qmd binary unavailable... no executable/Node entrypoint could be resolved without shell execution.
Omitting command entirely — memory status reports Provider: qmd, index shows 0/N files, and memory index --force fails because OpenClaw invokes the raw bin/qmd file (a POSIX shebang script, not valid JS/CJS) directly via node, producing SyntaxError: Invalid or unexpected token on the # shebang comment.
Actual behavior
QMD never successfully indexes or searches when invoked through OpenClaw's memory.backend = "qmd" integration, regardless of how command is configured:
With command set to the .js path: fails with Error: Cannot find module 'C:\Users<user>.openclaw\workspace\UsersAppDataRoamingnpmnode_modules@tobiluqmddistcliqmd.js' — the absolute path has its separators stripped and is concatenated onto the workspace path.
With command set to the .cmd wrapper: same mangling pattern, plus an additional error — qmd binary unavailable... no executable/Node entrypoint could be resolved without shell execution.
With command omitted: memory status reports Provider: qmd and 0/N files indexed, and memory index --force / memory search fail with SyntaxError: Invalid or unexpected token — OpenClaw is invoking node_modules/@tobilu/qmd/bin/qmd (a POSIX shebang script) directly via node, which cannot parse the shebang comment line.
In all three cases the index remains empty (0/N files · 0 chunks) and every qmd collection add / qmd update call fails with one of the above errors. The only way to get a working memory backend is to set memory.backend = "builtin", which bypasses QMD entirely.
OpenClaw version
OpenClaw 2026.6.5 (5181e4f)
Operating system
windows 11
Install method
No response
Model
anthropic haiku
Provider / routing chain
na
Additional provider/model setup details
No response
Logs, screenshots, and evidence
Impact and severity
No response
Additional information
No response
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
clawsweeper commentedon Jun 12, 2026
Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed June 21, 2026, 7:46 AM ET / 11:46 UTC.
Summary
Keep this issue open: current main and the latest release still have the reported QMD command parser path, and two open clean PRs currently claim this issue with the same backend-config fix boundary.
Reproducibility: yes. Current main routes
memory.qmd.commandthroughsplitShellArgs, and that parser consumes unquoted backslashes before QMD spawn code sees the command; the issue discussion also includes Windows output using the exported parser.Root-cause cluster
Relationship:
canonicalCanonical: #92302
Summary: This issue is the canonical open report for Windows
memory.qmd.commandseparator stripping in the QMD backend-config parser boundary.Members:
fixed_by_candidate: fix(memory): preserve Windows QMD command paths #95274 - Open clean PR with closing syntax for this issue, sufficient real behavior proof, and a focused backend-config resolver plus regression tests.fixed_by_candidate: fix: #92302 preserve Windows absolute paths in QMD command resolution #94665 - Open clean PR with closing syntax for this issue and the same parser-boundary approach, but current labels still indicate proof is not sufficient.superseded: fix(qmd): preserve Windows absolute paths in command resolution #94841 - Closed unmerged same-root-cause PR with useful Windows proof context; it is not a live landing candidate.Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.
Next step
No new repair job should be queued because open linked PRs already target the exact parser boundary, with #95274 currently the strongest candidate.
Review details
Best possible solution:
Land one canonical backend-config command-token fix, preferably #95274 if review remains clean, then close this issue as implemented.
Do we have a high-confidence way to reproduce the issue?
Yes. Current main routes
memory.qmd.commandthroughsplitShellArgs, and that parser consumes unquoted backslashes before QMD spawn code sees the command; the issue discussion also includes Windows output using the exported parser.Is this the best way to solve the issue?
Yes. The narrow maintainable fix is to preserve Windows drive-letter and UNC executable command tokens in backend config before shell-style parsing, rather than changing the shared parser globally or trying to repair the command later in spawn resolution.
AGENTS.md: found and applied where relevant.
Remaining risk / open question:
Codex review notes: model internal, reasoning high; reviewed against d1cbe29f3d52.
Label changes
Label justifications:
P1: The issue blocks an existing QMD memory backend workflow on Windows while the documented absolute command path remains accepted configuration.impact:other: The concrete impact is a disabled QMD memory backend on Windows, which is maintainer-visible but outside the narrower owned impact classes.Evidence reviewed
What I checked:
AGENTS.md:1, d1cbe29f3d52)resolveMemoryBackendConfigstill trimsmemory.qmd.command, passes it tosplitShellArgs, and stores the first parsed token as the QMD command. (packages/memory-host-sdk/src/host/backend-config.ts:441, d1cbe29f3d52)splitShellArgstreats an unquoted backslash as an escape marker, matching the reported collapse ofC:\Users\...into a separator-stripped token. (src/utils/shell-argv.ts:32, d1cbe29f3d52)this.qmd.commandintoresolveCliSpawnInvocation, so spawn handling receives the command after backend-config tokenization has already happened. (extensions/memory-core/src/memory/qmd-manager.ts:2111, d1cbe29f3d52)memory.qmd.commandas the QMD executable path and explicitly says to set an absolute path when the service PATH differs from the shell. Public docs:docs/reference/memory-config.md. (docs/reference/memory-config.md:478, d1cbe29f3d52)rawCommand -> splitShellArgs(rawCommand) -> parsedCommand[0]QMD command parsing code, so the issue is not fixed in the latest release. (packages/memory-host-sdk/src/host/backend-config.ts:441, c645ec4555c0)Likely related people:
src/utils/shell-argv.ts,src/memory/backend-config.ts,packages/memory-host-sdk/src/host/backend-config.ts)src/utils/shell-argv.ts,src/memory/backend-config.ts)packages/memory-host-sdk, which now owns the affected boundary. (role: major memory-host refactor author; confidence: medium; commits: eebce9e9c7cb; files:packages/memory-host-sdk/src/host/backend-config.ts,packages/memory-host-sdk/src/host/qmd-process.ts)packages/memory-host-sdk/src/host/qmd-process.ts,extensions/memory-core/src/memory/search-manager.ts,extensions/memory-core/src/memory/qmd-manager.ts)How this review workflow works
@clawsweeper re-reviewcomments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.@clawsweeper re-reviewor@clawsweeper re-runon an open PR or issue to request a fresh review only.@clawsweeper reviewto request a fresh review only.@clawsweeper autofix,@clawsweeper automerge,@clawsweeper fix ci, or@clawsweeper address review.@clawsweeper explainto ask for more context, or@clawsweeper stopto stop active automation.fix(qmd): preserve complete Windows paths including spaces in command…
Pick-cat commentedon Jun 19, 2026
Reproduced on Windows — root cause confirmed
The path mangling originates in
splitShellArgs(src/utils/shell-argv.ts), a POSIX-style shell tokenizer that is used to parsememory.qmd.commandinpackages/memory-host-sdk/src/host/backend-config.ts:441-443:When the configured value is an unquoted absolute Windows path,
splitShellArgstreats every\as a POSIX escape character and drops it (src/utils/shell-argv.ts:32-35):So the path collapses into a single backslash-free token, which is then resolved relative to the workspace directory — producing the
Cannot find module 'C:\Users\<user>\.openclaw\workspace\Users<user>AppData...'error in the report.Proof (Windows, using the actual exported
splitShellArgs):The derived
C:Userspenny...qmd.jsmatches the reporter's mangledUsers<user>AppDataRoamingnpmnode_modules@tobiluqmddistcliqmd.jsexactly, confirming the bug is in OpenClaw's command parsing rather than in QMD.Suggested fix direction: don't run a POSIX shell splitter over a config value that is normally a bare path on Windows. Either detect an absolute Windows path and skip tokenizing, only split when the value is quoted or contains whitespace/flags, or normalize separators before tokenizing. A regression test feeding a
C:\...path throughbackend-configwould lock this down.striveagencyco-droid commentedon Jun 21, 2026
Since the command works in CLI but fails through the memory backend, I would log the exact command argv that OpenClaw is constructing before spawn.
Good evidence to add:
memory.qmd.commandwith user paths redacted.cmdor.ps1shim avoids the path concatenation issueThe key is to avoid testing only the human shell command; the failing surface is the programmatic spawn path and its cwd/env/path normalization.