Repository navigation
fix(memory): keep gateway search read-only and reuse managers - #139013
saladinyao-cyber wants to merge 2 commits into
Conversation
|
🦞👀 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: needs real behavior proof before merge. Reviewed September 5, 2026, 7:42 AM ET / 11:42 UTC. ClawSweeper reviewWhat this changesGateway memory searches acquire reusable read-only index managers, validate persisted index readiness, and stop closing managers after each request. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readiness⛔ Blocked before merge - 10 items remain The PR remains useful, but its readiness checks introduce three search regressions. Current main still uses transient Gateway managers, so closure as implemented is unsupported. Priority: P2 Review scores
Verification
How this fits togetherThe Control UI sends memory queries to the Gateway, which obtains a search manager from the active memory plugin. Memory Core searches the agent’s SQLite index and returns ranked snippets or an unavailable response. flowchart LR
A[Memory search UI] --> B[Gateway search request]
B --> C[Memory plugin registry]
C --> D[Reusable read-only manager]
D --> E{Index ready?}
E -->|Yes| F[Keyword and vector retrieval]
E -->|No| G[Unavailable response]
F --> H[Ranked memory snippets]
Decision needed
Why: The patch intentionally removes bootstrap and maintenance behavior used by the existing Gateway path and adds a plugin-runtime lifetime contract; code inspection cannot establish acceptance of that operator-facing change. Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +137, Tests +103. Total +240 across 14 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Consolidate validation into the existing schema owner, preserve supported fallback searches, and pair reusable readers with writer-owned initialization and visible index recovery. Do we have a high-confidence way to reproduce the issue? Yes, source establishes failing paths for a configured-fallback index, native-vector rebuild debt, and malformed FTS tables; existing tests define the corresponding expected behavior. No runtime reproduction was executed in this read-only review. Is this the best way to solve the issue? No. Registry reuse and isolated readers are reasonable, but readiness checks bypass established fallback behavior and duplicate a stronger schema validator. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against e55f25b15ea6. 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
|
What Problem This Solves
Gateway and tool
memory_searchcan currently acquire maintenance-capable managers. That may trigger index mutation during a read request and repeatedly construct/close managers, adding latency and creating avoidable SQLite/provider lifecycle races.Why This Change Was Made
Add an explicit read-only manager mode that opens the existing index without running sync or migration work, validates the persisted schema/index identity, and fails closed when maintenance is required. Retain and reuse those read-only managers through the existing scoped registry lifecycle while preserving one-shot behavior for explicit CLI searches.
User Impact
Normal gateway memory searches remain read-only, avoid surprise indexing work, and reuse healthy managers. Dirty, incomplete, or identity-mismatched indexes return actionable unavailable state instead of being silently mutated by search.
Evidence
memory.searchtests passed.git diff --checkpassed.main.This PR intentionally excludes the separate 30-second deadline change in #139003.