Repository navigation
fix(memory): preserve requested corpus outcomes - #126530
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 19, 2026, 11:37 PM ET / August 20, 2026, 03:37 UTC. ClawSweeper reviewWhat this changesThe PR centralizes memory and wiki corpus attempts so Merge readinessKeep open. This maintainer-authored draft provides a coherent owner-boundary repair for silent partial corpus outcomes; no concrete patch defect was found, but it still needs the promised exact-base changed-surface gate before readiness review. Priority: P1 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherMemory Core tools combine built-in memory with registered corpus supplements such as memory-wiki, then return structured recall results to an agent. The new coordinator records each corpus outcome, merges surviving results, and emits warnings into the tool response. flowchart LR
A[Agent memory request] --> B[Memory Core tool]
B --> C[Corpus coordinator]
C --> D[Built-in memory attempt]
C --> E[Wiki supplement attempt]
D --> F[Outcome metadata]
E --> F
F --> G[Structured tool result]
G --> H[Agent response]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +123, Tests +207, Other 0. Total +330 across 10 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Retain one corpus-attempt coordinator for both search and exact reads, complete the exact-base changed-surface validation, and then review the documented result-shape transition as a deliberate compatibility change. Do we have a high-confidence way to reproduce the issue? Yes—source inspection of current main shows the sequential exact-read flow can return memory without recording wiki and can hide a failed wiki fallback; the PR also reports an exact-head isolated live exercise of both tools. Is this the best way to solve the issue? Yes—the shared coordinator is the narrowest maintainable fix because it makes deadline, partial-result, ordering, and metadata rules common to search and exact reads instead of preserving two divergent fallback paths. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 916eef4e9960. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Land-ready proof for
Known proof gap: the authenticated live fixture had no registered wiki supplement. Registered, unavailable, and multi-supplement wiki paths are covered by focused boundary tests. No operator Gateway or normal OpenClaw state was touched. |
|
Merged via squash.
|
Related: #125978
AI-assisted implementation; reviewed and verified by the maintainer.
What Problem This Solves
Fixes an issue where
memory_searchandmemory_getcould hide requested-corpus failures. Acorpus=allrequest could fail as one unit, or a cooldown retry could silently omit memory, even when another corpus still had usable results.Why This Change Was Made
Memory-core now represents each requested corpus with one closed
ok,unavailable, ornot-registeredattempt. Search and exact reads share one metadata composer and one bounded supplement settlement path.corpus=allexecutes memory and wiki independently under one deadline, keeps surviving results, and reports deterministic outcomes and warnings; exact reads retain memory payload precedence while still reporting the wiki outcome after a successful memory read.This is PR 2 of the split memory contract repair and builds on merged PR #125979's explicit
ok/not_foundread contract.Production LOC: +574/-451 (net +123). Tests: +415/-208. The new corpus owner adds 225 lines, while the refactor removes 135 net lines from
tools.ts, removes duplicate supplement paths, and replaces repetitive exact-read tests with a behavior matrix.User Impact
Agents receive usable memory or wiki results when another requested corpus is unavailable, with explicit warnings instead of silent omission. Cooldown retries remain visible.
memory_get corpus=allreports both corpus outcomes even when memory succeeds.Evidence
Validated on base
916eef4e996008d387207c53044afd8cf02dcc30; current head isb740adf3bcfe5de1cf7a278d3c6716113db083bd.git diff --check: passed.anthropic/claude-sonnet-4-6:memory_search(corpus="all")returned the indexedAQUAMARINE-84result with memory=ok, wiki=not-registered, and an explicit warning.memory_get(corpus="all")returned the memory file with the same two outcomes and warning.No operator gateway or normal OpenClaw state was touched. No LanceDB path, SQLite schema version, protocol version, lockfile, docs, or changelog is changed.