Repository navigation
perf(plugins): prepare cleanup migration policy under lease - #159338
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 27, 2026, 12:04 AM ET / 04:04 UTC (Revision 2). ClawSweeper reviewWhat this changesDuring plugin replacement, the branch reads deferred migration rows through a worker while holding the plugin lease, passes them to fresh source-cleanup checks, and updates regression tests and worker-access documentation. Merge readiness✅ Ready for maintainer review Current main still queries deferred migration rows synchronously during plugin source cleanup. The merged companion PR addressed the installed index, leaving this repair distinct. No actionable patch defect was found, and the new upgrade evidence addresses the prior proof request. Priority: P2 Review scores
Verification
How this fits togetherA plugin replacement batch receives committed install records and a runtime activation result. Before removing the old source, it checks the installed index, pending migrations, current config, source identity, and plugin lease. flowchart LR
A[Plugin replacement] --> B[Runtime activation]
B --> C[Cleanup lease]
C --> D[Worker reads index and migrations]
D --> E[Live config and source checks]
E --> F[Retain or remove old source]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +20, Tests +83, Docs +2. Total +105 across 4 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep source retirement bound to current lease ownership and fresh config and filesystem checks, while obtaining migration facts through the existing worker. Do we have a high-confidence way to reproduce the issue? Yes, by source: current main calls the synchronous migration reader from each cleanup guard, and the PR reports five targeted failures on its original main baseline. This read-only review did not execute the tests. Is this the best way to solve the issue? Yes. The existing worker and plugin lease remove repeated caller-thread migration queries while preserving live config and source checks at deletion. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 4c88390c72d7. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
@clawsweeper re-review The requested runtime and upgrade evidence is now complete for unchanged head The exact candidate passed 77 focused tests across seven files, including all 19 batch cases. The same regression file on original main The actual published 9.4 updater installed the newly built candidate, then the installed CLI completed the real Git-to-ClawHub Claw requirement with genuine PTY confirmations. The same Gateway PID activated version 2 while the old Git tree still existed, and cleanup then removed that tree. Payload identity, archive integrity, ledger ownership, unrelated state, workspace, SQLite integrity and schema checks passed. No provider inference or provider credentials were used by the synthetic fixture. Testbox run: https://github.com/openclaw/openclaw/actions/runs/36291423102 (cell exit 0). Candidate tarball SHA-256: |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
What Problem This Solves
After plugin replacement, each source-cleanup policy check rereads deferred migration rows from SQLite on the caller thread. The batch already holds the lease that excludes their writers.
User Impact
Cleanup prepares those migration rows through the existing worker while retaining the plugin lease. Every existing guard still reads current config files, included files and environment substitutions, and retains its source identity and durable lease checks. The public synchronous policy reader, stored formats and update behavior stay unchanged.
Why This Change Was Made
The batch reacquires plugin custody after runtime activation, awaits its migration rows, and checks authority again. Only private cleanup wrappers receive those rows. The config owner consumes them while rebuilding its config view for every guard. This avoids retaining a stale config verdict or assuming that a root config lock covers external edits and shared includes.
Evidence
Exact candidate
df43b924passed 77 tests across seven focused plugin, Claw and config files. The changed batch file passed all 19 cases. On original main038b10b4, the same test file produced exactly five intended failures: three missing policy-read handoffs and two caller-thread migration queries; the other 14 cases passed. The full focused invocation took 430.81 seconds on the loaded development host, including 33 seconds of worker preparation; the 19 batch cases' reported durations total 276.829 seconds. These are validation timings, not a performance benchmark.The actual published
[email protected]updater installed this separately built candidate successfully. The installed CLI then performed a real Git-to-ClawHub plugin replacement through a Claw requirement and genuine PTY confirmations. Version 2 activated in the same Gateway PID before the retired Git tree was removed. Exact installed payload, archive integrity, ledger ownership, unrelated state, workspace bytes, SQLite integrity and schema checks passed. Candidate tarball SHA-256:97b85deddc1cf77e9d22d137e4193d810300b34aef904664be635803531a810b. The Testbox run hosted the cell; its command exited zero. The full private proof and package are retained.Exact-head CI passed 130 jobs with 20 skips; checkout
b41f2df3combines this head with main61ff4469. Independent source review found no actionable finding. Four earlier wrapper attempts stopped during source sync before tests; native debug isolated the generated-bundle transfer path. The supported installed Crabbox CLI then synchronized the clean exact candidate and ran the cell with a normal frozen install. No sync bypass, timeout change, provider change, or prior candidate result was used.