Repository navigation
fix(cli): close standalone memory managers after commands - #118500
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 3, 2026, 1:38 AM ET / 05:38 UTC. ClawSweeper reviewWhat this changesThe PR marks standalone plugin-backed memory managers as active so the CLI finalizer closes their watcher-owning runtime after memory-backed commands finish. Merge readinessThis is still necessary: current main’s CLI finalizer only cleans up when the global memory-runtime check is true, but standalone plugin-backed managers are intentionally outside that registry. The branch records that owner-boundary fact and uses the existing finalizer/cleanup path; no discrete correctness defect was found. The protected Priority: P2 Review scores
Verification
How this fits togetherStandalone CLI commands can lazily load a configured memory plugin without registering it in the gateway’s active plugin registry. The CLI finalizer consults memory runtime state before calling shared cleanup, which must release filesystem watchers without making ordinary help or configuration commands load the memory runtime. flowchart LR
A[CLI wiki command] --> B[Memory runtime owner]
B --> C[Standalone plugin registry]
C --> D[Memory manager and watcher]
D --> E[Runtime activity fact]
E --> F[CLI finalizer]
F --> G[Close memory managers]
G --> H[Natural process exit]
Decision needed
Why: The patch is small and source-supported, but the Before merge
Agent review detailsSecurityNone. PR surfaceSource +16, Tests +68. Total +84 across 3 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the owner-boundary activity fact after protected-label review and exact-head CI complete, while retaining the existing lazy finalizer so non-memory CLI commands do not import the memory runtime. Do we have a high-confidence way to reproduce the issue? Yes. Source establishes that a standalone watcher-owning manager can be created while current main’s CLI finalizer sees no active global memory runtime; the PR body also supplies after-fix packaged command transcripts with natural exits. Is this the best way to solve the issue? Yes. Recording the resource-ownership fact in the standalone memory-runtime owner enables the existing shared cleanup without importing heavy memory code for ordinary CLI commands. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 607cf8fb6f2e. 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 (1 earlier review cycle)
|
|
Merged via squash.
|
… dream sessions, drop malformed artifacts (openclaw#70135, openclaw#118500, openclaw#66358, openclaw#101953)
What Problem This Solves
Standalone memory-backed commands such as
openclaw wiki get ... --jsonprinted their correct result but never exited because standalone memory managers retained active filesystem watchers.Why This Change Was Made
The memory-runtime owner records the authoritative standalone-manager activity fact in the existing lightweight runtime-presence owner. The unchanged CLI finalizer can then close both current and retired standalone managers without importing heavy memory code for ordinary help/status commands.
User Impact
Memory-backed CLI commands terminate naturally after returning their result. Commands that never initialize memory retain their intentional fast startup behavior.
Real Packaged CLI / SQLite / Watcher Proof
Exact committed memory-state/runtime candidate files were rebuilt on an isolated Testbox and run through the actual packaged operator CLI, real configured memory-core, real per-agent SQLite, and its default live filesystem watcher:
Before the fix, the same genuine successful commands emitted complete JSON but remained alive until a supervisor killed the leaking process. Testbox run: https://github.com/openclaw/openclaw/actions/runs/30787071524
Regression Evidence
6c9b38862d2) bypassed the intentional lightweight startup guard (a5cb9ec674b).