Repository navigation
fix: retain copied plugin resources through media cleanup - #143530
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review in progressClawSweeper is reviewing this revision. This supersedes any previous blocked status. |
|
@clawsweeper re-review The previous review job ended without publishing a review. Please retry this unchanged head; the required CI checks have passed. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review The review checkout metadata fix has landed in openclaw/clawsweeper#1519. Please review the current head using the updated preparation path; the source and validation evidence in this PR are current. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Codex review: needs maintainer review before merge. Reviewed September 9, 2026, 9:46 PM ET / September 10, 2026, 01:46 UTC (Revision 2). ClawSweeper reviewWhat this changesThe PR keeps resources behind copied plugin callbacks alive through accepted media tasks and final cleanup, propagates disposal failures, and adds regression coverage and lifecycle documentation. Merge readiness✅ Ready for maintainer review This remains a necessary, focused repair: current main still releases copied-callback resources before their final users finish. No actionable correctness or security findings remain, and the related aggregate is explicitly not a landing candidate. Priority: P2 Review scores
Verification
How this fits togetherPrepared model runtimes collect plugin callbacks used by image, music, and video tools. Their resource owners must keep those callbacks usable through accepted work and cleanup while independently rejecting new work after retirement. flowchart TD
A[Managed source registry] --> B[Prepared plugin view]
B --> C{New work admitted?}
C -->|Retired| D[Reject new task]
C -->|Accepted| E[Media generation and saving]
E --> F[Primary and rollback cleanup]
F --> G[Release borrowed source]
G --> H[Completion or disposal error]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +44, Tests +361, Docs +5. Total +410 across 6 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep borrowed resources under the primary registration's physical lifetime, with retirement fencing new work and final cleanup preserving error reporting. Do we have a high-confidence way to reproduce the issue? Yes, from source: retire construction/publication owners while an accepted media callback retains its inspection, then resume donor access or primary cleanup. Current main can release the donor first; this review did not execute the regression. Is this the best way to solve the issue? Yes. Moving the existing donor claim into the physical resource owner repairs the lifetime boundary and removes the competing manager-level release path without changing configuration or public APIs. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 04b265be7fd8. LabelsLabel 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)
|
|
Merged via squash.
|
Related: #140674
What Problem This Solves
Detached media tasks could retain their primary prepared registrations while losing the managed donor behind copied callbacks. The last prepared-manager release closed the donor even though an accepted media task or the primary registration's disposer could still use it.
Why This Change Was Made
Move the existing donor claim into the primary inspection's physical resource owner. Final release joins the primary's disposers and tracked work, including cleanup already started by rollback, before releasing the donor. Cleanup failures remain awaited and reported. Retirement still refuses new media admission immediately; this does not extend authority or change raw host ownership. The separate prepared-manager donor release path is removed.
User Impact
Accepted media tasks and their cleanup can finish using copied plugin callbacks after the original prepared view retires. Resources close after their last physical user finishes.
Evidence
Validation: 71 focused tests cover the actual detached image task, construction/publication-manager retirement, primary and donor cleanup failures, started rollback, raw donors, and Image/Music/Video sibling behavior. Regression checks reproduce the original premature SQLite close and the rollback ordering defect. The complete changed gate, documentation check, independent Codex review, and normal build passed (233.23 seconds).
The compiled synthetic proof exercised genuine managed acquisition, non-read-only workspace preparation through the existing inbound-loader seam, and the actual image tool. It verified admission refusal after retirement, donor access during accepted work and primary cleanup, awaited cleanup failure, saved PNG readability, single disposal, and SQLite reopen. The compiled process joined in 2.039 seconds with build artifacts unchanged and no TypeScript source fallback. Actual manager retirement and detached scheduling are composed separately in the maintained native test; no external provider or live account was used.