Skip to content

fix(memory/qmd): log when scope denies search#11652

Merged
vignesh07 merged 1 commit into
mainfrom
codex/qmd-scope-deny-logging-10191
Feb 8, 2026
Merged

fix(memory/qmd): log when scope denies search#11652
vignesh07 merged 1 commit into
mainfrom
codex/qmd-scope-deny-logging-10191

Conversation

@vignesh07

@vignesh07 vignesh07 commented Feb 8, 2026

Copy link
Copy Markdown
Member

Summary

  • Log explicit warnings when memory.qmd.scope denies a memory_search request.
  • Include derived channel/chatType/session in the warning payload for quick debugging.
  • Add regression tests for the deny path.

Why

Fixes #10191. Scope-denied searches were silently returning empty results, which looked like missing memory instead of policy gating.

Changes

  • src/memory/qmd-manager.ts
    • Added logScopeDenied(sessionKey) helper.
    • Emit warning when scope blocks a search.
  • src/memory/qmd-manager.test.ts
    • Mocked logger and added logs when qmd scope denies search test.
    • Asserted no query subprocess is spawned in the deny path.
  • docs/concepts/memory.md
    • Documented scope-deny warning behavior.
  • CHANGELOG.md
    • Added #10191 fix note.

Validation

  • pnpm test src/memory/qmd-manager.test.ts
  • pnpm check

Greptile Overview

Greptile Summary

This PR adds explicit warning logs when memory.qmd.scope denies a memory_search request, including derived channel, chatType, and the session key in the log message to make scope-gated empty results easier to diagnose. It also adds a regression test that verifies the deny path returns [], emits the warning, and does not spawn the QMD query subprocess.

The behavioral change is localized to QmdMemoryManager.search() and uses the existing session-key parsing helpers (deriveChannelFromKey / deriveChatTypeFromKey) to populate the warning payload. Documentation and changelog are updated to reflect the new warning behavior.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk.
  • Change is small and localized (adds a warning + test for an existing deny path) and does not alter allowed search behavior; the new test covers the main regression (deny returns empty and avoids spawning QMD).
  • No files require special attention

@openclaw-barnacle openclaw-barnacle Bot added the docs Improvements or additions to documentation label Feb 8, 2026
@vignesh07 vignesh07 merged commit 7f7d49a into main Feb 8, 2026
24 of 25 checks passed
@vignesh07 vignesh07 deleted the codex/qmd-scope-deny-logging-10191 branch February 8, 2026 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

QMD memory_search silently returns empty in Discord guild channels (default scope denies chatType 'channel')

1 participant