Repository navigation
fix: prevent plugin state open failures after read-only inspection - #150236
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 maintainer review before merge. Reviewed September 16, 2026, 6:48 PM ET / 22:48 UTC (Revision 4). ClawSweeper reviewWhat this changesPrevents read-only database inspection from leaving stale identity records that block later plugin-state writes, with regression coverage for inode reuse, alias publication, and replacement exclusion. Merge readiness✅ Ready for maintainer review Keep open: current main still needs this focused repair. No introduced correctness or security blocker was found, and the related PRs address distinct failures. Priority: P2 Review scores
Verification
How this fits togetherPlugins store persistent values through OpenClaw’s shared SQLite worker. The database lifecycle owner tracks physical files and controls admission so opening, closing, and replacing a database remain coordinated. flowchart TD
A[Read-only inspection] --> B[Inspect file identity]
B --> C[Return identity without retaining ownership]
D[Plugin state operation] --> E[Capture lifecycle admission]
E --> F[Open SQLite worker and publish identity]
F --> G{Admission still current}
G -->|Yes| H[Read or write plugin state]
G -->|No| E
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -1, Tests +105. Total +104 across 3 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep advisory inspection free of retained lifecycle ownership, and reconcile first creation through the existing owner while preserving close and replacement invalidation. Do we have a high-confidence way to reproduce the issue? Yes, from source: read-only inspection retains an inode record on current main, and reuse can invalidate a fresh worker’s admission during publication. The PR supplies a deterministic regression; this review did not execute it. Is this the best way to solve the issue? Yes. Repairing identity bookkeeping at the existing lifecycle owner addresses the cause without retries, competing state, or consumer-specific workarounds. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 6caadadb6762. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles)
|
b9ca85f to
b7a7259
Compare
b7a7259 to
6dc5e70
Compare
Honor existing force requests after a closing receipt only when control, output, lineage and kernel group-disappearance facts permit reclaiming the retained direct relay. Confirm actual exit within the original hard deadline and retain timing, signal-delivery errors and observed exit facts. Keep stop() compatible and expose the optional cleanup result without reviving a retired connection. Fresh driver executions remain available. Related: #150236
Keep advisory database identity reads out of the lifecycle admission map. Bind first creation through aliases at publication while preserving physical replacement and exclusion checks.
6dc5e70 to
447c77d
Compare
|
Merged via squash.
|
Honor existing force requests after a closing receipt only when control, output, lineage and kernel group-disappearance facts permit reclaiming the retained direct relay. Confirm actual exit within the original hard deadline and retain timing, signal-delivery errors and observed exit facts. Keep stop() compatible and expose the optional cleanup result without reviving a retired connection. Fresh driver executions remain available. Related: #150236
…150260) Keep incomplete and mixed annotation indexing coverage while timing the historical backtracking witness at the parser owner. Related: openclaw#150236, openclaw#138995.
…penclaw#150236) Keep advisory database identity reads out of the lifecycle admission map. Bind first creation through aliases at publication while preserving physical replacement and exclusion checks.
Honor existing force requests after a closing receipt only when control, output, lineage and kernel group-disappearance facts permit reclaiming the retained direct relay. Confirm actual exit within the original hard deadline and retain timing, signal-delivery errors and observed exit facts. Keep stop() compatible and expose the optional cleanup result without reviving a retired connection. Fresh driver executions remain available. Related: #150236
Service-child cleanup could report an unavailable MCP driver when a retired relay or anchor remained alive after the closing receipt and pipe closure. Retain pending force requests in the existing cleanup owner, reap a live anchor through its relay, then retire the retained relay handle. Confirm actual exit and group disappearance within the original hard deadline, preserving signal-delivery errors and forced-cleanup diagnostics. Fresh driver executions can connect afterward. The CUA proxy cleanup-deadline flake on hosted runners was a symptom of this cleanup gap. The accompanying shell-test fix narrows whole-module child_process autospy to native-backed spawnSync, preventing shared-worker prototype contamination and recursive kill calls without relaxing cleanup assertions or deadlines. Exact-head CI passed without reruns: https://github.com/openclaw/openclaw/actions/runs/35182765072 Retained proof includes real-process stall, failed-delivery, late-exit, fresh-client and ordered shared-worker replay coverage. Codex review and the exact-head ClawSweeper review have no remaining actionable findings within their stated scope. Related: #150236
Service-child cleanup could report an unavailable MCP driver when a retired relay or anchor remained alive after the closing receipt and pipe closure. Retain pending force requests in the existing cleanup owner, reap a live anchor through its relay, then retire the retained relay handle. Confirm actual exit and group disappearance within the original hard deadline, preserving signal-delivery errors and forced-cleanup diagnostics. Fresh driver executions can connect afterward. The CUA proxy cleanup-deadline flake on hosted runners was a symptom of this cleanup gap. The accompanying shell-test fix narrows whole-module child_process autospy to native-backed spawnSync, preventing shared-worker prototype contamination and recursive kill calls without relaxing cleanup assertions or deadlines. Exact-head CI passed without reruns: https://github.com/openclaw/openclaw/actions/runs/35182765072 Retained proof includes real-process stall, failed-delivery, late-exit, fresh-client and ordered shared-worker replay coverage. Codex review and the exact-head ClawSweeper review have no remaining actionable findings within their stated scope. Related: openclaw#150236
What Problem This Solves
Fixes plugin state writes failing to open a fresh database when the filesystem reuses an inode from a deleted file that OpenClaw previously inspected read-only. Observed in the unchanged plugin-state tests on #149913 (failed hosted job).
User Impact
Fresh plugin state remains writable after completed or refused read-only inspection of an unrelated database. Storage formats, schema versions, update/rollback behavior, and operator configuration are unchanged.
Why This Change Was Made
The lifecycle owner's advisory identity lookup was creating persistent admission records without owning a cached database. A closed read-only file could be deleted while its inode remained recorded. If that inode was reused, publication of a new worker-created file collided with the stale record and invalidated its own admission.
Inspect unowned paths without recording them, and bind first creation through native aliases at actual publication. Existing captures and published owners retain their cached identity, generation checks, and close/exclusion behavior. No retry, timeout, or consumer fallback is added.
Evidence
The new regression exercises real read-only inspection, file deletion, worker opening, and plugin register/lookup. It controls only the inode allocator outcome; both successful and schema-refused read cases fail on the original production code with the same hosted stack:
--cache=falsefor hosted file order.--repeats=29): 120/120, covering inode reuse, native alias publication, and replacement exclusion.--mode branch --base origin/main --max-priority P1).Production delta: +3/-4 (net -1); tests and test support: +105/-0. Head:
b9ca85fe564daa498488610be0783304e34e42e4.Native Linux inode reuse is modeled deterministically; the repeated neighborhood runs execute on macOS with Node 26.8.2. The hosted test uses isolated fork workers, so cross-file module leakage is not needed to explain this failure.