Skip to content

perf(memory): add QMD search diagnostics and runtime cache#96655

Merged
bek91 merged 6 commits into
mainfrom
feat/qmd-wrapper
Jun 26, 2026
Merged

perf(memory): add QMD search diagnostics and runtime cache#96655
bek91 merged 6 commits into
mainfrom
feat/qmd-wrapper

Conversation

@bek91

@bek91 bek91 commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Refs #96561.

memory_search and openclaw memory search currently have several seconds of wrapper-side latency above raw QMD search time. Before changing the query strategy further, maintainers need reliable attribution for manager acquisition, tool overhead, QMD collection validation, QMD capability probing, and search grouping.

Baseline Metrics (Pre-Patch)

CLI Trace

A traced openclaw memory search invocation with QMD showed this shape:

collection list --json                         180ms
collection show memory-root-main               155ms
collection show memory-dir-main                157ms
collection show workspace-main                 171ms
collection show sessions-main                  153ms
qmd --help                                     147ms
vsearch memory collections                    1019ms
vsearch sessions-main                          988ms

openclaw memory search total:                  5.59s
time inside QMD children:                     ~2.97s
wrapper/OpenClaw overhead:                    ~2.6s

Relevant config in that environment:

memory.qmd.searchMode = "vsearch"
agents.defaults.memorySearch.sources = ["memory", "sessions"]
memory.qmd.limits.timeoutMs = 30000

timeoutMs = 30000 does not appear to cause the latency; it only raises the ceiling so searches do not hit a shorter timeout. The relevant behavior is that memory + sessions currently multiplies subprocess work.

Tool Timing

The standard OpenClaw memory_search tool path was also timed separately and showed similar overhead above direct QMD:

openclaw__memory_search query="qmd latency openclaw memory embedding" maxResults=5: 11.27s
repeat, all sources, maxResults=5:                                             8.43s
repeat, all sources, maxResults=1:                                             8.63s
memory corpus only:                                                            7.18s
sessions corpus only:                                                          6.95s

direct QMD single/vector-ish path:                                             ~1.0-1.5s
openclaw memory search CLI:                                                    ~5.6-9.9s
standard memory_search tool:                                                   ~7-11s

maxResults=1 did not materially improve tool-call timing, and corpus-specific searches were still around 7s. That points away from result volume and toward fixed wrapper/search-path overhead.

A later trace compared wall time against the tool result's own debug.searchMs field. From source, debug.searchMs starts after manager acquisition and covers the measured search body plus tool-side filtering/decorating, so the gap points at work before or outside that measured search body:

all sources, maxResults=5
wall: 7183ms
debug.searchMs: 2383ms
outside debug timer: 4800ms

all sources, maxResults=5 repeat
wall: 7774ms
debug.searchMs: 2818ms
outside debug timer: 4956ms

all sources, maxResults=1
wall: 7209ms
debug.searchMs: 2420ms
outside debug timer: 4789ms

memory corpus only
wall: 6263ms
debug.searchMs: 1464ms
outside debug timer: 4799ms

sessions corpus only
wall: 6149ms
debug.searchMs: 1324ms
outside debug timer: 4825ms

The stable ~4.8-5.0s outside debug.searchMs suggests fixed pre-search overhead in the standard tool path.

Why This Change Was Made

This is the diagnostics-first and near-term cache PR for the QMD wrapper latency issue. It intentionally does not redesign QMD search grouping yet.

Changes included:

  • Adds additive memory-search debug fields for manager acquisition, manager cache state, tool wall time, outside-search time, QMD collection validation, QMD multi-collection probe, and QMD search plan details.
  • Adds a persisted memory-core plugin-state cache for QMD collection validation and multi-collection support probes, with bounded TTLs and fail-open behavior.
  • Keys QMD cache entries by agent/workspace, configured QMD command, QMD runtime identity from qmd --version when available, a hashed QMD runtime spawn-environment fingerprint, QMD index path, search mode, sources, and managed collection config.
  • Forces collection validation repair to bypass the cache when a search reports a missing managed collection.
  • Keeps QMD runtime diagnostics isolated per search so overlapping memory_search calls cannot overwrite or consume each other's debug state on a shared warm manager.
  • Merges QMD debug data across the zero-hit retry path, preserving one-time validation/probe attribution while using the final attempt for effective mode/search plan.
  • Rewrites the persisted multi-collection probe cache to supported: false when a real combined collection-filter invocation is rejected.
  • Preserves manager debug metadata through the memory-core runtime provider.
  • Keeps transient CLI manager state injected through the internal engine facade instead of exposing arbitrary memory-core state opening from the public host-runtime SDK path.
  • Adds regression coverage for cache hits/misses, failure fail-open behavior, forced repair bypass, one-shot QMD debug reporting, concurrent debug isolation, stale probe invalidation, retry debug merging, runtime-provider debug passthrough, and tool debug timing propagation.

User Impact

QMD-backed memory searches should avoid repeated collection-list/show/help subprocess work across transient CLI/search-manager instances while preserving repair behavior when QMD reports stale or missing collections.

The debug payload now separates manager/tool/wrapper time from QMD search time so future latency fixes can be verified against real wall-clock attribution.

AI-assisted change; I reviewed the code, structured review output, and validation output before updating this draft PR.

Evidence

Latest validation after rebasing onto current origin/main at 1cd6f81a46 and adding the hashed QMD runtime environment cache key:

.agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main
node scripts/run-vitest.mjs extensions/memory-core/src/memory/qmd-runtime-cache.test.ts extensions/memory-core/src/memory/qmd-manager.test.ts extensions/memory-core/src/memory/search-manager.test.ts extensions/memory-core/src/tools.test.ts extensions/memory-core/src/runtime-provider.test.ts src/plugin-sdk/memory-core-engine-runtime.test.ts
node scripts/check-sdk-package-extension-import-boundary.mjs
node scripts/check-src-extension-import-boundary.mjs
node --max-old-space-size=8192 --import tsx scripts/generate-plugin-sdk-api-baseline.ts --check
git diff --check origin/main...HEAD
git merge-tree --write-tree origin/main HEAD

Results:

  • Autoreview: clean, no accepted/actionable findings.
  • Targeted Vitest: passed, 2 shards, 6 files, 214 tests.
  • SDK/package and src extension import boundary checks: passed.
  • Direct plugin SDK API baseline check: passed.
  • Diff whitespace check: passed.
  • Merge simulation against origin/main: clean.

Real Behavior Proof: QMD Cache And Repair

Redactions used below: <PROOF_ROOT>, <WORKSPACE>, <STATE>, <HOME>, <QMD_BIN>, and <SNIPPET>. The proof used a synthetic temp workspace/state/home only, with synthetic MEMORY.md and memory/secondary.md content containing the query token basalt citrine qmd proof token.

Repeated CLI-purpose QMD manager path, fresh cache then persisted cache hit:

proofOrder=cli-first

cli-manager-miss:
  elapsedMs=417
  managerCacheState=transient-cli
  managerMs=993
  resultCount=2
  qmd.collectionValidation={cacheState:write, elapsedMs:934, collectionCount:2, listCalls:1, showCalls:0}
  qmd.multiCollectionProbe={cacheState:write, elapsedMs:208, supported:true}
  qmd.searchPlan={command:search, collectionCount:2, groupCount:1, sources:[memory]}

cli-manager-hit:
  elapsedMs=200
  managerCacheState=transient-cli
  managerMs=202
  resultCount=2
  qmd.collectionValidation={cacheState:hit, elapsedMs:199, collectionCount:2, listCalls:0, showCalls:0}
  qmd.multiCollectionProbe={cacheState:hit, elapsedMs:0, supported:true}
  qmd.searchPlan={command:search, collectionCount:2, groupCount:1, sources:[memory]}

Repeated memory_search tool path, fresh cache then persisted cache hit:

proofOrder=tool-first

memory-search-tool-miss:
  elapsedMs=1626
  debug.managerCacheState=transient-cli
  debug.managerMs=934
  debug.searchMs=616
  debug.toolMs=1625
  debug.outsideSearchMs=1009
  debug.hits=2
  debug.qmd.collectionValidation={cacheState:write, elapsedMs:894, collectionCount:2, listCalls:1, showCalls:0}
  debug.qmd.multiCollectionProbe={cacheState:write, elapsedMs:193, supported:true}
  debug.qmd.searchPlan={command:search, collectionCount:2, groupCount:1, sources:[memory]}

memory-search-tool-hit:
  elapsedMs=433
  debug.managerCacheState=transient-cli
  debug.managerMs=220
  debug.searchMs=212
  debug.toolMs=432
  debug.outsideSearchMs=220
  debug.hits=2
  debug.qmd.collectionValidation={cacheState:hit, elapsedMs:217, collectionCount:2, listCalls:0, showCalls:0}
  debug.qmd.multiCollectionProbe={cacheState:hit, elapsedMs:0, supported:true}
  debug.qmd.searchPlan={command:search, collectionCount:2, groupCount:1, sources:[memory]}

Repeated openclaw memory search --json source-dev CLI timing against the same temp state also returned the two synthetic hits:

openclaw-memory-search-first:
  elapsedMs=6537
  exitCode=0
  results=2
  stderr="[memory] qmd manager initialized for agent \"main\" mode=cli collections=2 durationMs=399"

openclaw-memory-search-second:
  elapsedMs=6140
  exitCode=0
  results=2
  stderr="[memory] qmd manager initialized for agent \"main\" mode=cli collections=2 durationMs=239"

Forced missing-collection repair after warming the cache:

removedCollection=<COLLECTION:memory-root-main>
qmdRemoveExitCode=0
qmdRemoveOutput="Removed collection 'memory-root-main'; Deleted 1 documents; Cleaned up 1 orphaned content hashes"

missing-collection-repair:
  elapsedMs=1430
  managerCacheState=transient-cli
  managerMs=204
  resultCount=2
  qmd.collectionValidation={cacheState:bypass-force, elapsedMs:1012, collectionCount:2, listCalls:1, showCalls:1}
  qmd.multiCollectionProbe={cacheState:hit, elapsedMs:1, supported:true}
  qmd.searchPlan={command:search, collectionCount:2, groupCount:1, sources:[memory]}

Known scope note: this PR does not yet change QMD to one combined multi-collection candidate search or parallelize grouped source searches; it adds attribution and removes repeated validation/probe work first.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation extensions: memory-core Extension: memory-core size: XL maintainer Maintainer-authored PR labels Jun 25, 2026
@clawsweeper

clawsweeper Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed June 26, 2026, 4:08 PM ET / 20:08 UTC.

Summary
The PR adds QMD memory-search timing diagnostics, manager/debug propagation, and SQLite-backed plugin-state caches for QMD collection validation and multi-collection probing.

PR surface: Source +934, Tests +969, Generated 0. Total +1903 across 15 files.

Reproducibility: yes. at source/proof level: current main still routes QMD CLI/tool search through the implicated manager and debug-timer paths, and the PR supplies before/after CLI/tool logs. I did not run live QMD timing in this read-only review.

Review metrics: 2 noteworthy metrics.

  • Persisted QMD Cache Namespaces: 2 added. Collection-validation and multi-collection probe results become plugin-state data, so cache keying, TTL, and invalidation matter before merge.
  • Memory Debug Groups: 3 QMD groups added. Collection-validation, multi-collection-probe, and search-plan diagnostics expand the observable memory debug payload across runtime/API surfaces.

Stored data model
Persistent data-model change detected: persistent cache schema: extensions/memory-core/src/memory/qmd-manager.ts, persistent cache schema: extensions/memory-core/src/memory/qmd-runtime-cache.test.ts, persistent cache schema: extensions/memory-core/src/memory/qmd-runtime-cache.ts, serialized state: extensions/memory-core/src/memory/qmd-manager.test.ts, unknown-data-model-change: extensions/memory-core/src/memory/qmd-manager.test.ts, unknown-data-model-change: extensions/memory-core/src/memory/qmd-manager.ts, and 16 more. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #96561
Summary: This PR is a partial candidate implementation for the broader open QMD memory-search overhead tracker.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🦞 diamond lobster
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P2] Get explicit maintainer acceptance of the persisted QMD cache contract and expanded debug payload before merge.

Risk before merge

  • [P1] The branch adds persisted plugin-state cache entries for QMD validation/probe results, so maintainers need to accept the TTL, keying, invalidation, and fail-open tradeoff before merge.
  • [P1] The memory debug payload expands through SDK/runtime type surfaces, so maintainers should decide whether these diagnostics are supported contract surface or internal telemetry.

Maintainer options:

  1. Accept Cache And Debug Contracts (recommended)
    A maintainer can approve the TTL/key/fail-open cache behavior and expanded debug payload as a partial latency mitigation while leaving the broader search-strategy tracker open.
  2. Split Diagnostics From Persistence
    If persisted cache invalidation is not ready, split the timing/debug payload from the cache so diagnostics can land independently.
  3. Pause For Broader QMD Redesign
    If maintainers do not want a cache-first mitigation, keep the linked tracker as the owner and pause or close this branch.

Next step before merge

  • [P2] The remaining action is maintainer acceptance of the compatibility-sensitive cache/debug contracts, not a narrow automated repair.

Security
Cleared: No concrete security or supply-chain concern was found; the diff does not change dependencies, workflows, secrets handling, or downloaded code execution.

Review details

Best possible solution:

Merge only after maintainer acceptance of the persisted QMD cache behavior and expanded debug surface, while keeping the broader QMD search strategy issue open.

Do we have a high-confidence way to reproduce the issue?

Yes, at source/proof level: current main still routes QMD CLI/tool search through the implicated manager and debug-timer paths, and the PR supplies before/after CLI/tool logs. I did not run live QMD timing in this read-only review.

Is this the best way to solve the issue?

Yes as a bounded first step, not as the full fix for the linked QMD overhead tracker. The implementation stays in memory-core, uses the existing SQLite plugin-state seam, and leaves broader grouped-search/concurrency decisions to the canonical issue.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 1089253ca97c.

Label changes

Label justifications:

  • P2: This is a normal-priority memory-core performance and diagnostics PR with limited blast radius but compatibility-sensitive runtime changes.
  • merge-risk: 🚨 compatibility: The branch adds persisted plugin-state cache behavior and expands memory debug/runtime types that maintainers need to accept as an upgrade contract.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (logs): The PR body and follow-up comments include redacted real CLI/tool logs showing cache writes, cache hits, returned hits, timing deltas, and forced missing-collection repair bypass behavior.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body and follow-up comments include redacted real CLI/tool logs showing cache writes, cache hits, returned hits, timing deltas, and forced missing-collection repair bypass behavior.
Evidence reviewed

PR surface:

Source +934, Tests +969, Generated 0. Total +1903 across 15 files.

View PR surface stats
Area Files Added Removed Net
Source 9 956 22 +934
Tests 5 969 0 +969
Docs 0 0 0 0
Config 0 0 0 0
Generated 1 2 2 0
Other 0 0 0 0
Total 15 1927 24 +1903

What I checked:

  • Repository policy applied: Root and scoped policy were read; the applicable guidance treats plugin APIs, persisted state, fallback behavior, and runtime cache changes as compatibility-sensitive review surfaces. (AGENTS.md:34, 1089253ca97c)
  • Scoped policy applied: The extensions and plugin SDK guides require bundled plugins to use SDK seams and keep expanded contracts aligned with API checks and docs/exports. (extensions/AGENTS.md:1, 1089253ca97c)
  • Live PR state requires maintainer handling: Live GitHub metadata shows this PR is open, non-draft, cleanly mergeable, author association CONTRIBUTOR, and carries the protected maintainer label, so cleanup-close is not allowed. (3c5bcd06ebbc)
  • Current main still has the transient CLI manager path: Current main treats purpose === "cli" as transient, which matches the repeated manager setup path the PR mitigates. (extensions/memory-core/src/memory/search-manager.ts:163, 1089253ca97c)
  • Current main still validates QMD collections during manager initialization: Current main initializes QMD managers by calling ensureCollections(), which is the validation/probe work the PR caches. (extensions/memory-core/src/memory/qmd-manager.ts:537, 1089253ca97c)
  • Current main debug timer excludes manager acquisition: Current main obtains the memory manager before searchStartedAt, so debug.searchMs does not include manager acquisition and some wrapper work. (extensions/memory-core/src/tools.ts:433, 1089253ca97c)

Likely related people:

  • jalehman: Recent merged history includes memory transcript corpus and QMD session identity refactors on the affected QMD manager, search manager, and tool paths. (role: recent memory-core and QMD refactor owner; confidence: high; commits: c24d266b2d09, d3781cc4b8ec; files: extensions/memory-core/src/memory/qmd-manager.ts, extensions/memory-core/src/memory/search-manager.ts, extensions/memory-core/src/tools.ts)
  • steipete: Recent history includes QMD subprocess abort work and memory host SDK/package surface work adjacent to this cache and debug-surface change. (role: historical QMD search and SDK contributor; confidence: high; commits: 73dd758310e8, 8b6bed9c9c2f, dc3df62e67c7; files: extensions/memory-core/src/memory/qmd-manager.ts, extensions/memory-core/src/tools.ts, packages/memory-host-sdk/src/host/types.ts)
  • TurboTheTurtle: Merged work kept memory_search in transient QMD mode and reported skipped QMD probes, directly adjacent to the manager lifetime behavior this PR mitigates. (role: recent transient QMD lifecycle contributor; confidence: medium; commits: ddacb7ba39d4, 6aff1e8f9ea4; files: extensions/memory-core/src/memory/search-manager.ts, extensions/memory-core/src/memory/qmd-manager.ts)
  • Alix-007: Recent commits threaded abort handling through grouped collection and mcporter QMD search paths, adjacent to the multi-collection probe/search behavior under review. (role: recent grouped QMD search contributor; confidence: medium; commits: 2a021f3b9b49; files: extensions/memory-core/src/memory/qmd-manager.ts)
  • bek91: Beyond this PR, prior merged history includes QMD manager creation dedupe work in the affected search-manager area. (role: previous memory manager contributor and current PR author; confidence: medium; commits: dfe0e49c8a3f; files: extensions/memory-core/src/memory/search-manager.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Jun 25, 2026
@bek91 bek91 changed the title [codex] perf(memory): add QMD search diagnostics and runtime cache perf(memory): add QMD search diagnostics and runtime cache Jun 25, 2026
@bek91

bek91 commented Jun 25, 2026

Copy link
Copy Markdown
Contributor Author

Step 1 to resolve #96561

@bek91
bek91 force-pushed the feat/qmd-wrapper branch from 7fe4b99 to fc562fc Compare June 26, 2026 04:09
@bek91

bek91 commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@bek91

bek91 commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jun 26, 2026
@bek91
bek91 force-pushed the feat/qmd-wrapper branch from fc562fc to 2ba7019 Compare June 26, 2026 16:50
@bek91

bek91 commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Resolved the reported merge conflict by rebasing onto current origin/main (1cd6f81a46) and pushed the rebased branch at 2ba70193ba6dde6fcd36ce72e4c484eab720013e.

Also addressed the cache-key risk by adding a hashed QMD runtime spawn-environment fingerprint to the persisted validation/probe cache context, so PATH/XDG/QMD/HOME-relevant environment changes produce cache misses instead of waiting for TTL expiry. Added regression coverage for validation and probe cache misses when that fingerprint changes.

Fresh validation:

node scripts/run-vitest.mjs extensions/memory-core/src/memory/qmd-runtime-cache.test.ts extensions/memory-core/src/memory/qmd-manager.test.ts extensions/memory-core/src/memory/search-manager.test.ts extensions/memory-core/src/tools.test.ts extensions/memory-core/src/runtime-provider.test.ts src/plugin-sdk/memory-core-engine-runtime.test.ts
node scripts/check-sdk-package-extension-import-boundary.mjs
node scripts/check-src-extension-import-boundary.mjs
node --max-old-space-size=8192 --import tsx scripts/generate-plugin-sdk-api-baseline.ts --check
git diff --check
git diff --check origin/main...HEAD
git merge-tree --write-tree origin/main HEAD

Results: targeted Vitest passed, 2 shards / 6 files / 215 tests; both boundary checks passed; API baseline check passed; whitespace checks passed; merge simulation clean.

@clawsweeper

clawsweeper Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@bek91
bek91 marked this pull request as ready for review June 26, 2026 17:31
@bek91

bek91 commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

I ran the same-machine env 2 comparison.

Scope: isolated temp OpenClaw state, same synthetic corpus, same query, same QMD binary/device.
Before = origin/main at 1cd6f81
After = PR branch at 2ba7019.

Main results

Surface Before: origin/main After: PR branch Notes
Direct CLI-purpose manager, search call 1 416ms 430ms Similar actual search-body timing on the small corpus.
Direct CLI-purpose manager, search call 2 423ms 308ms Slightly faster after warm cache.
QMD manager init logs 790ms, then ~1.5s repeated 1015ms, then ~220ms repeated Clearest OpenClaw-side improvement: repeated validation/probe work drops.
memory_search tool, first measured call 2389ms 800ms Same env/corpus; after call was cache-hit due to warmed cache by CLI-manager step.
memory_search tool, repeat 1933ms 448ms Strong warm-path improvement.
Source CLI first run 19.299s 15.774s Includes source build/runtime-postbuild, so noisy.
Source CLI repeat 7.628s 5.712s More useful than first run, still includes source-runner process overhead.
Source CLI manager init on repeat 1526ms 221ms Matches the cache effect.

After-branch debug also proves the cache behavior directly:

After diagnostic Cold/write Warm/hit
Validation cache write, list/show=1/0, ~1014ms hit, list/show=0/0, ~221ms
Probe cache write, ~207ms hit, 0ms
Missing-collection repair bypass-force, list/show=1/1, ~1094ms Proves repair bypasses validation cache.

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Jun 26, 2026
@clawsweeper clawsweeper Bot added status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jun 26, 2026
@bek91

bek91 commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

I ran 5 alternating before/after pairs in env 2.

Order was:

before1 -> after1 -> before2 -> after2 -> ... -> before5 -> after5

Each branch got 5 full harness runs. Each full run included 2 direct CLI-manager searches, 2 memory_search tool calls, 2 source CLI subprocess calls, and 1 forced missing-collection repair. All source CLI subprocesses exited 0 and returned 2 hits.

Metric, median of 5 samples unless noted Before origin/main After PR Median delta
memory_search tool first call 2.156s 0.743s -1.413s
memory_search tool repeat 1.863s 0.422s -1.441s
Source CLI first call 7.980s 8.230s +0.250s
Source CLI repeat 7.522s 6.167s -1.355s
Direct CLI-manager repeat search 405ms 213ms -192ms
QMD manager init log samples, median across all harness init logs 1.449s 214ms -1.235s

After-branch correctness checks from the same 5 runs:

Check Result
Tool validation cache 10/10 tool calls reported hit, list/show=0/0
Tool probe cache 10/10 tool calls reported hit
Missing-collection repair 5/5 reported bypass-force, list/show=1/1

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jun 26, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jun 26, 2026
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jun 26, 2026
@bek91
bek91 merged commit 9636bea into main Jun 26, 2026
115 of 119 checks passed
@bek91
bek91 deleted the feat/qmd-wrapper branch June 26, 2026 20:16
wangmiao0668000666 pushed a commit to wangmiao0668000666/openclaw that referenced this pull request Jun 27, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jun 27, 2026
xydigit-zt pushed a commit to xydigit-zt/xydigit-zt-openclaw that referenced this pull request Jun 28, 2026
QiuYuang pushed a commit to QiuYuang/openclaw that referenced this pull request Jul 1, 2026
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 extensions: memory-core Extension: memory-core maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant