Skip to content

fix(memory): reject invalid QMD search results - #115705

Merged
steipete merged 1 commit into
mainfrom
codex/fix-qmd-primitive-results-114315
Jul 29, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/fix-qmd-primitive-results-114315

Conversation

@steipete-oai

Copy link
Copy Markdown
Contributor

Closes #114315
Related contributor investigation: #114319 (thank you @kevin2966n).

What Problem This Solves

Fixes an issue where QMD memory search accepted arrays containing null, strings, numbers, booleans, nested arrays, or mixed invalid entries as typed search results. Downstream memory-manager callers dereference result objects, so malformed provider output could escape its parsing boundary and crash memory retrieval.

Why This Change Was Made

Validate every result array entry at the existing private QMD parser boundary before normalization. Reject an invalid payload as invalid JSON-shaped result data; preserve clean object results, QMD no-results markers, logged/noisy result recovery, and all existing plugin-facing signatures. No dependency, configuration, fallback, storage schema, provider change, or public Plugin SDK change.

User Impact

Malformed QMD provider output fails safely with the existing actionable parse error; valid memory recall and existing noisy QMD search behavior continue unchanged.

Evidence

  • Genuine fail-first against fresh main: all six new QMD cases fail on unchanged production because invalid values are incorrectly returned to typed consumers.

  • Exact final head: 23 parser tests (including all 6 regression cases), 27 QMD-process tests, and all 162 real QMD memory-manager tests pass: 212/212.

  • Standalone Node 24 real-parser proof: REAL_QMD_RESULT_BOUNDARY_PASS; rejected null/string/number/boolean/nested/mixed payloads while a real valid QMD result retained its document, score, and snippet.

  • Full exact-head CI=1 pnpm check:changed: passed, including format, max-line ratchet, core and test typechecks, typed lint, SDK contract, plugin boundaries, schema/storage guards, and import-cycle checks.

  • Independent exact-commit gpt-5.6-sol extra-high-effort review: clean, correctness 0.97.

  • Blacksmith Testbox: tbx_01kyp9c9e2k906hr6fdbwt05et.

  • Report and broader original investigation: thanks @kevin2966n (QMD primitive result entries cross the typed parser boundary #114315, fix(memory): preserve index and session-state integrity #114319). This PR intentionally claims only the independently proven malformed-QMD-result bug.

  • Exact final commit: 6f9b436f80d064ab1f0f85b008a20258a4688c1a.

@steipete-oai
steipete-oai marked this pull request as ready for review July 29, 2026 06:50
@openclaw-barnacle openclaw-barnacle Bot added size: XS maintainer Maintainer-authored PR labels Jul 29, 2026
@steipete
steipete force-pushed the codex/fix-qmd-primitive-results-114315 branch from 6f9b436 to 39c631c Compare July 29, 2026 07:05
@openclaw-barnacle openclaw-barnacle Bot reopened this Jul 29, 2026
@steipete
steipete merged commit 3274328 into main Jul 29, 2026
309 of 315 checks passed
@steipete
steipete deleted the codex/fix-qmd-primitive-results-114315 branch July 29, 2026 08:36
@steipete

Copy link
Copy Markdown
Contributor

Merged via squash.

vincentkoc added a commit that referenced this pull request Jul 29, 2026
* origin/main:
  fix(zalo): stop provider startup after gateway shutdown (#115763)
  fix(agents): bound completed background process retention (#115760)
  fix(plugins): bound hook execution and retire stale registrations (#115695)
  fix(ui): collapse custodian startup error gap (#115720)
  fix(gateway): reload edited hook transforms (#107875)
  refactor: centralize channel streaming config hints (#115739)
  fix(msteams): finalize sent replies after dispatch (#82354)
  fix(cron): deliver explicitly configured failure alerts (#115762)
  fix(hooks): resolve inbound claim conversation once (#115491)
  refactor: retire legacy provider and secret paths (#115655)
  fix(memory): reject malformed QMD result entries (#115705)
  fix(diagnostics): keep internal thinking out of telemetry [AI] (#115261)
  fix(ui): localize remaining control surfaces (#115730)
  fix(gateway): prevent model owner mismatch after plugin activation (#115747)
  fix(agents): run reply hooks for restart recovery (#115711)
  fix(cron): initialize detached hook run sessions (#115765)
  fix(ios): keep stop available for staged voice notes (#115744)
  fix(doctor): preserve config includes during cleanup (#115723)
  fix(memory): keep dreaming consolidation within project scope (#115721)
  fix(discord): keep tool rows under verbose progress (#111947)

# Conflicts:
#	ui/src/pages/custodian/custodian-surface.ts
#	ui/src/styles/custodian.css
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

QMD primitive result entries cross the typed parser boundary

2 participants