Repository navigation
fix(memory): report closed storage scopes accurately - #178187
Conversation
Preserve the SQLite scope error code through manager initialization and report storage recovery advice without changing scope retirement or provider diagnostics. Related: #177882.
…memory-search-scope-closed-diagnostic
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: needs maintainer review before merge. What this changesThis PR preserves closed SQLite scope error codes and returns storage-specific recovery advice from memory_search. Example: memory_search encounters SQLITE_READONLY_WORKER_SCOPE_CLOSED.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Partial Merge readiness✅ Ready for maintainer review Keep open: this PR provides a useful, narrowly scoped diagnostic correction; no introduced correctness or security defect was found. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherMemory Core acquires an index manager and runs searches through lifecycle-owned SQLite readers, then translates failures into model-visible tool results. flowchart LR
A[Agent memory_search] --> B[Memory Core tool]
B --> C[Index manager]
C --> D[SQLite reader scope]
D --> E[Typed closed scope error]
E --> F[Storage diagnostic]
F --> A
Technical reviewBest possible solution: Preserve this diagnostic correction while tracking the unresolved reader-binding failure in #177882. Do we have a high-confidence way to reproduce the issue? Source confirms that closed reader scopes throw while current main drops initialization codes and defaults to provider advice; no current-main runtime reproduction was executed. Is this the best way to solve the issue? The patch uses the existing reader and diagnostic owners, preserves retirement, and makes the smallest complete correction to the stated diagnostic bug. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 23af78ff67ae. Provenance checked
TestingProof path: unit tests only. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +1, Tests +52, Docs +5. Total +58 across 11 files. Added test files: 0. View PR surface stats
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
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 Reviewed October 20, 2026, 3:15 AM ET / 07:15 UTC. |
|
Merged via squash.
|
…enclaw#178187) Preserve the SQLite scope error code through manager initialization and report storage recovery advice without changing scope retirement or provider diagnostics. Related: openclaw#177882.
Related: #177882
What Problem This Solves
Fixes the misleading embedding/provider diagnosis when
memory_searchfails because its SQLite read-only storage scope has closed.User Impact
The unavailable result now identifies the closed storage scope and advises
openclaw plugins reload memory-coreor a Gateway restart before retrying. Provider failures keep their existing diagnostic, including when their message happens to mention a closed scope. Scope retirement, cancellation, and search recovery behavior are unchanged; this does not fix or automatically reopen the persistent closed-scope condition reported in #177882.Why This Change Was Made
The SQLite owner emitted a plain error, and manager initialization discarded error codes when turning failures into text. The owner now emits a typed
SQLITE_READONLY_WORKER_SCOPE_CLOSEDerror, and Memory Core preserves that code through initialization and search classification. Classification uses the code, never the message. The parameter-forwarding cleanup removes a duplicate input shape and field projection from the same diagnostic path.The lifecycle investigation remains unresolved: Gateway startup owns a reader scope that closes on shutdown or failed startup. Deferred agent admission uses temporary scopes after plugins attach, and prepared workspace registries adopt matching Gateway-owned tool registrations. We have not identified which temporary binding survives into the reported failing
memory_search, or why that tool would not use the Gateway-owned registration. Deliberate retirement still rejects work; automatically reviving it would violate that contract.To investigate that remaining issue, collect the exact OpenClaw version/commit, the failing tool's error/warning/action and any recorded error code, and timestamped startup-admission and plugin load/reload events. Targeted tracing should correlate scope creation and closure with the Memory Core instance/registry generation and the selected tool registration, including whether source/config matching caused Gateway tool adoption to be skipped. Exclude credentials, message content, and unrelated private data from shared evidence.
Evidence
d0f33d7f36932dcd8f4e9da5a675c92bc32f407e: 60 successful jobs, 25 skipped, no failures or reruns.config/tsconfig/oxlint.core.json: passed. Oxfmt on all 11 changed files andgit diff --check: passed.classifies a closed storage scope by code during initialization/search;does not classify a provider error by storage-scope wording;preserves the builtin initialization error code. Existing captured-scope and descendant-inspection tests now also require the typed code while preserving rejection and no-launch assertions.