Repository navigation
fix(memory): preserve wiki results in combined search under load - #135290
Agent-Aurelius wants to merge 1 commit into
Conversation
Preserve exhaustive on-budget recall while forwarding cancellation through memory corpus supplements, vault validation, enumeration, and page reads. Prefilter raw nonmatches before expensive page parsing so large combined searches finish inside the existing budget. Closes openclaw#104719
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: blocked before merge. What this changesThe branch forwards memory-tool cancellation into Memory Wiki searches and reads, and filters raw Wiki pages before parsing to reduce work during large searches. Review scores
Merge readiness⛔ Blocked before merge - 10 items remain Keep this PR open. Current main and the latest release still have the uncancelled Wiki fallback, but this unchanged PR head has two blocking result and plugin compatibility defects. The proof-positive successor at #145732 still needs integration with current main, so it is not yet a safe superseding landing path. Priority: P1 Before merge
Findings
Agent review detailsHow this fits togetherThe memory tool sends Wiki requests through a registered corpus supplement into a local Markdown vault. The Wiki results return to the agent under a deadline owned by the memory tool. flowchart LR
A[Agent memory search] --> B[Memory tool deadline]
B --> C[Corpus supplement]
C --> D[Wiki vault search]
D --> E[Candidate page parsing]
E --> F[Wiki results]
F --> G[Agent response]
Technical reviewBest possible solution: Integrate one repair with current main’s safe Wiki reader: pass cancellation in a separate optional supplement context, keep candidate filtering conservative for decoded metadata, and absorb repeated checks into the owner where practical. Do we have a high-confidence way to reproduce the issue? Yes, from source: current main still invokes an uncancelled exhaustive scan after digest underfill. This read-only review did not execute a current-main reproduction. Is this the best way to solve the issue? No for this pinned head: cancellation belongs in a separate execution context, and raw filtering must preserve matches from decoded metadata. The successor follows that direction but still needs current-main integration. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 979a8beefb34. Merge-risk optionsMaintainer options:
SecurityNone. EvidenceWhat I checked:
PR surfaceSource +107, Tests +150, Docs +3. Total +260 across 14 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed September 25, 2026, 5:07 PM ET / 21:07 UTC (Revision 2). |
|
Rebased this PR onto current main (
Verification: 128/128 across the five touched test files; |
|
Current-main integration check from the independent Linux reproduction reported in #104719:
Our sanitized production baseline and acceptance matrix are in #104719 (comment). A current-main rebase is needed before we can evaluate this candidate for deployment. |
|
One current-main conflict needs security-sensitive resolution rather than a mechanical pick: Current Please preserve the current Our acceptance criterion is unchanged visibility and vault-boundary behavior alongside the deadline fix. |
|
Refreshed the branch against current main (
Verification: all five touched suites green — 131/131 ( |
Closes #104719
What Problem This Solves
Fixes an issue where
memory_searchwithcorpus: "all"could return memory hits plus a false Wiki-unavailable warning on large compiled vaults, even though the same Wiki query completed successfully on its own. The timed-out Wiki scan also kept reading files after the tool had already returned.Why This Change Was Made
The existing 15-second tool deadline remains unchanged. The repair forwards its cancellation signal through the public corpus-supplement contract, Memory Wiki activation and source validation, digest/fallback lookup, directory walks, and page reads. Exhaustive body recall is still preserved while the call is on-budget; a raw-text candidate filter avoids expensive YAML/Markdown parsing for pages that cannot match.
User Impact
Combined memory + Wiki recall can return healthy Wiki hits from large vaults without a false timeout caused by parse overhead. Genuine stalls still fail closed with the existing per-corpus warning, and cancellation now stops later Wiki I/O instead of leaving orphan work behind.
Evidence
429438066d6f0b9a).node scripts/run-vitest.mjs extensions/memory-core/src/tools.citations.test.ts extensions/memory-core/src/memory-get-corpus.test.ts extensions/memory-wiki/src/corpus-supplement.test.ts extensions/memory-wiki/src/query.test.ts extensions/memory-wiki/src/compiled-cache.integration.test.ts— 122 passed.pnpm build— passed, including all 147 public Plugin SDK subpaths.pnpm test:contracts:plugins— passed on the current head (46 files / 1,111 tests); the broader channel + plugin contract suite also passed before the mechanical current-main rebase.node scripts/check-changed.mjs -- <changed paths>— passed all selected core, plugin, docs, typecheck, lint, boundary, dead-export, and guard lanes.autoreview --mode branch --base origin/main— scoped clean.The operator Gateway remains on the pre-fix runtime; loading this unmerged candidate there would require replacing and restarting that production Gateway. Candidate runtime proof therefore used the same real vault through a read-only source driver, alongside the bounded owner tests above.