Bug Description
memory_search returns empty results with no errors or warnings when called from a Discord guild/server channel. Works fine in DMs.
Root Cause
The default QMD scope configuration in reply-DpTyb3Hh.js is:
const DEFAULT_QMD_SCOPE = {
default: "deny",
rules: [{
action: "allow",
match: { chatType: "direct" }
}]
};
Discord server channels resolve to chatType: "channel" (via deriveChatTypeFromKey), which does not match the "direct" rule. The default "deny" kicks in and the search returns [] immediately — with no log warning or error.
Impact
Anyone running OpenClaw with QMD memory backend in a Discord guild channel (which is probably most Discord users) will see memory_search return zero results. The silent failure makes this extremely difficult to debug — there is no indication that the search was blocked by scope rather than finding no matches.
We spent several hours investigating CUDA backends, Bun segfaults, timeouts, and environment variable propagation before discovering the actual cause was this one-line scope default.
Steps to Reproduce
- Configure
memory.backend: "qmd" (no custom scope config)
- Use OpenClaw from a Discord guild/server channel (not a DM)
- Call
memory_search with any query
- Results: always
[], no errors logged
Fix (User Workaround)
Add explicit scope rules to openclaw.json:
"memory": {
"backend": "qmd",
"qmd": {
"scope": {
"default": "deny",
"rules": [
{ "action": "allow", "match": { "chatType": "direct" } },
{ "action": "allow", "match": { "chatType": "channel" } }
]
}
}
}
Suggestions
- Log a warning when scope denies a search — something like
qmd search denied by scope (chatType=channel, session=...) would have saved hours of debugging
- Consider changing the default — if the security concern is group chats with strangers,
"channel" (guild channels) could be allowed by default since they are typically controlled spaces, while "group" (group DMs) could remain denied
- Document this behavior — the QMD scope defaults are not mentioned in the docs at https://docs.openclaw.ai/concepts/memory
Environment
- OpenClaw: 2026.2.3-1
- QMD: latest (via bun)
- Channel: Discord guild channel
- OS: Ubuntu 24.04.3 LTS
Bug Description
memory_searchreturns empty results with no errors or warnings when called from a Discord guild/server channel. Works fine in DMs.Root Cause
The default QMD scope configuration in
reply-DpTyb3Hh.jsis:Discord server channels resolve to
chatType: "channel"(viaderiveChatTypeFromKey), which does not match the"direct"rule. The default"deny"kicks in and the search returns[]immediately — with no log warning or error.Impact
Anyone running OpenClaw with QMD memory backend in a Discord guild channel (which is probably most Discord users) will see
memory_searchreturn zero results. The silent failure makes this extremely difficult to debug — there is no indication that the search was blocked by scope rather than finding no matches.We spent several hours investigating CUDA backends, Bun segfaults, timeouts, and environment variable propagation before discovering the actual cause was this one-line scope default.
Steps to Reproduce
memory.backend: "qmd"(no customscopeconfig)memory_searchwith any query[], no errors loggedFix (User Workaround)
Add explicit scope rules to
openclaw.json:Suggestions
qmd search denied by scope (chatType=channel, session=...)would have saved hours of debugging"channel"(guild channels) could be allowed by default since they are typically controlled spaces, while"group"(group DMs) could remain deniedEnvironment