Repository navigation
fix(doctor): release isolated state before cleanup - #147281
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: blocked before merge. Reviewed September 24, 2026, 5:33 PM ET / 21:33 UTC (Revision 23). ClawSweeper reviewWhat this changesThe branch makes OpenClaw’s Doctor health check close private SQLite readers and writers before snapshot cleanup, preserves findings when cleanup fails, observes moved skill directories on macOS, and updates related tests and documentation. Merge readiness⛔ Blocked before merge - 3 items remain Current main and v2026.9.6 still lack Doctor lint’s private auth-reader retirement. This PR remains a distinct, source-aligned fix with substantial installed-runtime proof. Priority: P2 Review scores
Verification
How this fits togetherDoctor lint runs health checks against a private copy of OpenClaw’s SQLite state and returns findings to CLI users or the installed updater. Its cleanup must release private database handles without disturbing live state. flowchart LR
A[CLI or updater] --> B[Doctor lint]
C[Live SQLite state] --> D[Private snapshot]
D --> B
B --> E[Close private handles]
E --> F{Cleanup complete?}
F --> G[Findings and status]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +94, Tests +778, Docs +5. Total +877 across 23 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep Doctor’s private snapshot lifecycle responsible for closing its own readers and writer, preserving the live database and a complete health report across cleanup outcomes. Do we have a high-confidence way to reproduce the issue? Yes. Current-main source leaves private pooled auth readers open before snapshot deletion, and the PR supplies installed-runtime observations of the affected cleanup path; this read-only review did not execute a failing main run. Is this the best way to solve the issue? Yes. The branch closes handles through their existing scoped owners and preserves completed findings when cleanup fails, without adding a storage or configuration contract. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 25f07e880f5d. 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 (22 earlier review cycles; latest 8 shown)
|
Co-authored-by: Copilot <[email protected]>
f3c147f to
27321fa
Compare
|
Independent Codex review of the current tip against The PR is conflicting with |
Integrate captured main d3160de while preserving the published PR and original contributor ancestry. Keep matching participant-event assertions after real execution/effect joining and retain exact upstream timeout-safe reset-hook cleanup. Make SSH approval observation abortable with idempotent fixture fallback: release held locks and probes, join real verifier/approval/preauth work and the enclosing LAN attempt, and always restore observers. Keep all distinct regressions, original assertions and published timeout budgets. Independent full-file API review is scoped-clean. Gateway63/63, Doctor40/40 and SSH11/11 pass; participant and absent-approval negative controls prove failure visibility and joined cleanup. Local watcher qualification remains 10/11; neither diagnostic success nor graceful-drain success proves the historical cause fixed. Required checks/actual-head CI and separate installed published-driver/native acceptance remain gates.
Require both the unchanged source-version advancement and actual parent watch acquisition before replacing a watched symlink with an ordinary directory. Exact failing traces showed a late initial-ready event could satisfy the old version-only wait before the symlink was observed. Keep the same 3000ms budget, all eleven cases and all admission/discovery checks. Resolve SSH fixture lint without changing cleanup semantics. Final normal watcher11/11 and SSH11/11 pass; independent API source review is scoped-clean. Full required checks and exact-head hosted CI remain required. No broad historical watcher/graceful-drain repair or installed-acceptance claim.
Wait for terminal execution and abort publication before retaining the original matching WebSocket assertions. Close task-owned SQLite workers through the existing scoped state fixture before deleting their directories. Preserve all regressions, budgets and contributor ancestry for PR openclaw#147281.
Retire snapshot-owned auth readers and state writers before removing private inspection state. Keep completed findings, check counts, cleanup warnings, and earlier detector errors visible when disposal fails. Reconcile the original branch with the current runtime-env loader and fixture owners. Preserve both watcher readiness/error observations and exact path observations, and document the cleanup behavior. Fresh independent P0-P2 source review is clean. Package and installed runtime acceptance remain to be qualified against this exact candidate. Co-authored-by: Gio Della-Libera <[email protected]> Co-authored-by: Jason (Json) <[email protected]>
Observe delivery callback entry before stopping admission or starting the reconnect drain. Handle recovery outcomes immediately and release and join blocked work on failure before shared-state teardown can begin. Retain synthetic native-plugin phase evidence when the CLI child fails, then rethrow the original error. Preserve the existing deadlines, assertions and case order; the initial startup delays remain unexplained.
Merge fixed main while preserving Doctor private database retirement and Darwin parent-entry observation. Keep native watcher recovery coverage and use the canonical outbound fixture readiness repair. Co-authored-by: Gio Della-Libera <[email protected]> Co-authored-by: Jason (Json) <[email protected]>
|
Merged via squash.
|
* fix(doctor): close isolated state handles * test(doctor): run Windows state isolation before grouped shard * test(doctor): isolate OAuth source-lock fixture and baseline * test(doctor): preserve explicit Windows shard target contract * test(doctor): preserve isolated cleanup and OAuth success proof * test(doctor): settle snapshot tokens and prepare OAuth worker fixtures * test(skills): capture watcher failure state before cleanup * test(gateway): join qualified SSH pairing verification Consume the main fadc546 prerequisite and the qualified follow-up from openclaw#147821. Preserve delayed rejection and in-handshake approval coverage, join real verification and approval work, and retain policy, scoped-request, mismatch and disabled-path regressions. The source matches the qualified supplier exactly. No authorization logic, retry policy or timeout budget changes. Co-authored-by: Peter Steinberger <[email protected]> * test(gateway): join lifecycle effects before root and hook assertions * test(gateway): consume landed reset-hook fixture cleanup * test(skills): await observed ancestor replacement Require both the unchanged source-version advancement and actual parent watch acquisition before replacing a watched symlink with an ordinary directory. Exact failing traces showed a late initial-ready event could satisfy the old version-only wait before the symlink was observed. Keep the same 3000ms budget, all eleven cases and all admission/discovery checks. Resolve SSH fixture lint without changing cleanup semantics. Final normal watcher11/11 and SSH11/11 pass; independent API source review is scoped-clean. Full required checks and exact-head hosted CI remain required. No broad historical watcher/graceful-drain repair or installed-acceptance claim. * test(gateway): join publishers and retire fixture state Wait for terminal execution and abort publication before retaining the original matching WebSocket assertions. Close task-owned SQLite workers through the existing scoped state fixture before deleting their directories. Preserve all regressions, budgets and contributor ancestry for PR openclaw#147281. * test: preserve recovery and CLI fixture failures Observe delivery callback entry before stopping admission or starting the reconnect drain. Handle recovery outcomes immediately and release and join blocked work on failure before shared-state teardown can begin. Retain synthetic native-plugin phase evidence when the CLI child fails, then rethrow the original error. Preserve the existing deadlines, assertions and case order; the initial startup delays remain unexplained. --------- Co-authored-by: Jason (Json) <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
Fixes Doctor lint cleanup failures when inspection leaves cached SQLite readers or a state writer open in its isolated snapshot.
User Impact
Doctor retires the private database handles before removing the snapshot. Cleanup problems preserve completed findings and check counts; update-marked runs can report incomplete removal as a warning. If database retirement fails, Doctor retains the snapshot and reports the failure. The storage schema and configuration contract stay the same.
Why This Change Was Made
The snapshot owner now settles scoped auth readers and the state database writer before deleting their files, while preserving detector errors when cleanup also fails. The Doctor lint documentation explains the cleanup outcomes.
The current-main integration preserves the Linux/Windows native watcher owner and the macOS parent-entry observation needed when a watched directory moves. Watcher fixtures retain both native recovery checks and synchronization on the actual symlink entry. The outbound recovery fixtures use the canonical readiness repair already on main.
Builds on the work of @giodl73-repo and @fuller-stack-dev, with both contributors' ancestry and credit preserved.
Evidence
The signed candidate is
6f9d20ee252b91e9a61fea625ae3712a3b4b05cc, incorporating fixed maine843a9a1d794e3ddc016e348558df6befa7e0380. Independent review of the complete PR diff found no actionable P0–P2 findings. Formatting and whitespace checks pass. This PR changes no UI runtime source relative to its incorporated main revision.Exact-head CI passed, including all three macOS Node lanes. The Darwin watcher integration exercised real ancestor moves on macOS 15.7.4 ARM64, Node 24.16.0, and Vitest 5.0.1. Earlier outbound fixture failures are covered by main's canonical readiness/settlement repair; the native-plugin diagnostic preserves its original timeout and error without claiming to fix an unproved startup cause.
Package Acceptance produced the final-source package normally. Producer, integrity, npm 12 installer, and Doctor-switch jobs passed. Artifact
10828298572, run attempt 1, containsopenclaw-current.tgz(2026.9.6), SHA-256c26b3232655af3547840e5ae710d8bc2b2b614843cb27259fa0dd3379a4882c4; its build-info identifies the exact candidate.The same package passed three additional installed Linux Doctor cases using a real registered synthetic plugin and the public provider-auth SDK. Node 24.19.0/npm 11.17.0 performed a normal production install with lifecycle scripts enabled; the native fs-safe verifier passed. Runtime used an isolated non-root container, synthetic state, no network or host mounts, and the default
/tmppermissions.Native syscall traces establish the ordering and actual EACCES errors; no mocked denial or forced handle closure is involved. The successful reader/writer main descriptors close at epoch 1790280329.231968/.235340, before database unlink at .240073/.240818 and outer-directory removal at .245993. Original source/config bytes remain unchanged after every case. Logical SDK readback uses a finalized copy. The returned schema finding is not described as a thrown detector exception. Two earlier fixture calibration failures are retained: a shallow snapshot-path assumption, then verification that directly read the source and changed SQLite sidecars. The corrected cases use the same immutable package. All containers settled, and the owned Testbox was stopped and verified completed.
Published-updater acceptance passed in artifact-only recovery 36057461016, using the same immutable candidate package and the reviewed harness fix in #157579. The authentic 2026.9.4 updater installed the exact 6f9 build and preserved Projects inventory. Both subsequent selected Doctor invocations and their preservation assertions passed: Projects rows/schema, the then-current configuration and SQLite bytes, and synthetic project files were preserved. The lane completed in 161 seconds. Its phase-evidence artifact records the complete sequence. The earlier failure was the observer counting a defining module and its generated forwarder; the shared resolver now selects the unique definition without weakening integrity checks. The original failure and two admission-only attempts remain recorded. The update-marked selected lint cases above remain separate from the stock updater's intentionally deferred inspection rehearsal; no additional internal first-hop post-core diagnostic claim is made.
A separate persistent-client installed witness found that initial agent creation was acknowledged before the new roster became visible to an immediately following session-creation RPC. That ownership issue is under investigation separately. It failed before deletion and therefore does not establish or clear the earlier CI error, “Agent database resources are closing,” after deletion and recreation. No lifecycle fix or waiver is claimed here.
Related: #149068's prior ordering hold is cleared.