Repository navigation
fix(memory): distinguish missing file reads - #125979
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
bbb281c to
703470b
Compare
|
Codex review: needs maintainer review before merge. Reviewed August 19, 2026, 10:50 PM ET / August 20, 2026, 02:50 UTC. ClawSweeper reviewWhat this changesThis PR adds explicit success/not-found statuses to memory-file reads, adapts legacy registered memory managers at acquisition, and updates memory consumers, SDK exports, tests, and migration guidance. Regression provenancePossible regression — probable (reviewed change; reproduction). No predecessor PR is attributed. Merge readinessThe final head addresses the prior compatibility blocker: statusless legacy reads now normalize to successful reads, while only explicit not-found values represent absence. This maintainer-owned draft remains necessary because current main still uses the ambiguous result shape; it needs exact-head validation before merge. Priority: P1 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherMemory plugins supply file excerpts to memory-core tools and the memory-wiki lookup path. The plugin runtime normalizes manager output before those consumers decide whether to return content, fall back to another corpus, or skip an absent file. flowchart LR
A[Memory file request] --> B[Memory manager]
B --> C[Plugin runtime adapter]
C --> D{Read status}
D -->|ok| E[Memory tool or wiki result]
D -->|not found| F[Fallback or skip]
G[Legacy manager result] --> C
Before merge
Agent review detailsSecurityNone. PR surfaceSource +99, Tests +174, Docs +14, Other +32. Total +319 across 22 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:
Technical reviewBest possible solution: Land one canonical discriminated read-result contract with the registration-bound legacy adapter, after exact-head validation confirms both absent files and statusless empty legacy successes remain distinct. Do we have a high-confidence way to reproduce the issue? Yes—source inspection gives a high-confidence path: current main returns an untagged empty result for a missing file, while the branch’s producer and consumer tests exercise explicit not-found and empty-success outcomes. This review did not execute the suite locally. Is this the best way to solve the issue? Yes—the producer-owned discriminated result plus a single registration-bound legacy adapter is the narrowest maintainable repair; it removes consumer-side heuristics without breaking statusless registered managers during the announced window. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 29cfd195d19d. 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
HistoryReview history (6 earlier review cycles)
|
703470b to
6d134ff
Compare
6d134ff to
6d3fde4
Compare
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Land-ready proof for
No LanceDB path, schema/protocol version, lockfile, or changelog is changed. Issue #125978 remains open for the separately split corpus-outcome, source-status, and guidance repairs. |
|
Merged via squash.
|
* fix(memory): distinguish missing file reads * test(memory): keep adapter identity assertion bound * fix(memory): preserve statusless manager reads
Related: #125978
AI-assisted implementation; reviewed and verified by the maintainer.
What Problem This Solves
Fixes an issue where
memory_getcould return a missing file as an empty successful read. That made a genuinely absent memory file indistinguishable from a valid empty excerpt and could cause agents to treat missing content as present.Why This Change Was Made
Canonical memory reads now return an explicit
status: "ok"orstatus: "not_found", so empty files and empty ranges cannot collide with missing files. Because pre-status memory-manager results shipped publicly, plugin registration accepts that legacy input temporarily and the host normalizes it once at manager acquisition. All statusless legacy results preserve their prior successful-read semantics; only an explicitnot_foundreports absence. The adapter preserves stable manager identity, receiver binding, and lifecycle behavior.This is PR 1 of the memory contract repair series. Corpus availability, source drift/status, and source-aware guidance remain tracked by #125978 and will land separately.
Production LOC: +121/-19 (net +102). Tests/support: +268/-65. Docs: +14. The growth is concentrated in the versioned registered-input/current-output contract, one host adapter, its compatibility record, and external producer/consumer type coverage.
User Impact
Built-in memory reads reliably distinguish missing files from valid empty excerpts. Existing registered memory managers keep their historical statusless success behavior through the next Plugin SDK major, while new producers can report absence explicitly.
Evidence
Validated against PR base
af3b86091f4bdc564c2df005259239c09cbc3e4f; current head isf121f4365454a07b844f3c44297593c9ce99d0ac.git diff --check: passed.node scripts/check-changed.mjs: passed across SDK surface checks, core/extension/script typechecks, lint, dead-export scans, compatibility guards, and architecture/storage guards.anthropic/claude-sonnet-4-6calledmemory_getformemory/definitely-missing-live-proof.md, receivedstatus: "not_found", and repliedSTATUS=not_found; 9 transcript events were verified in the isolated agent database.No operator gateway or normal OpenClaw state was touched. No LanceDB path, SQLite schema version, protocol version, lockfile, or changelog is changed.