Repository navigation
fix(plugins): release retired callers retained by cached errors - #149643
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 16, 2026, 12:16 AM ET / 04:16 UTC (Revision 2). ClawSweeper reviewWhat this changesThe PR converts cached plugin error stacks and wrapped causes to text so retired callers can be collected, adds collection regressions, and corrects a source-map-sensitive Gateway test. Merge readiness⛔ Blocked before merge - 1 item remains This remains a useful, distinct memory repair that current main does not contain. No blocking correctness findings remain; the inspected evidence supports the scoped fix without claiming that all reload memory growth is resolved. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw’s plugin cache retains metadata and diagnostics for discovery and reload operations. These diagnostics must remain available without keeping retired plugin registries and their callers alive. flowchart LR
A[Plugin metadata reads] --> B[Read or parse failure]
B --> C[Convert error stacks to text]
D[Cache retirement] --> C
C --> E[Retained diagnostic]
C --> F[Caller eligible for collection]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +26, Tests +208. Total +234 across 5 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep diagnostic detachment in the cache owner while preserving error identity and treating remaining reload-memory growth as separate work. Do we have a high-confidence way to reproduce the issue? Yes: current-main cached failures retain lazy stacks, and the supplied before/after collection cases exercise those production readers. This read-only review inspected source and recorded results without executing tests. Is this the best way to solve the issue? Yes: detaching diagnostic stacks at cache admission addresses the retaining owner without replacing errors, weakening file checks, or adding another cache lifecycle. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 027f99d61a93. 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)
|
|
Maintainer disposition for the review’s memory-limit item: land this focused repair as part of the five-PR retention stack, subject to CI and the native landing gates. The maintainer explicitly approved landing the stack with the documented remaining failure. This accepts the independently demonstrated owner repairs; it does not claim complete reload-memory acceptance. The 500-update ESM forced-GC result remains 36.65 MiB against the unchanged 32 MiB limit. The remaining native ESM module-job growth stays open for further work; no threshold increase, idle subtraction, or plateau claim is being used to turn that result green. The linked proof separately demonstrates caller collection, predecessor release, stopped-handle cleanup, bundled setup code reuse, and published-registry reuse. Functional reload/install/restart observations retain their recorded scope. Installed/source plugins keep their captured generations, and compiled bundled code replacement retains its documented build-and-restart requirement. |
|
Merged via squash.
|
…claw#149643) * fix(plugins): release callers retained by cached diagnostic stacks * fix(plugins): detach cached stacks from custom formatters * test(gateway): distinguish retained task data from source maps
Landed: merged into
mainasff7f96f6c132e9eb7be9d71888287ab2396574cfon September 16, 2026. Required CI passed on the final PR head. All five stack layers are merged; final receipts and before/after proof. The accepted partial repair boundary is unchanged: ESM forced-GC growth remains 36.65 MiB against the 32 MiB limit.What Problem This Solves
Cached metadata failures kept retired plugin registries alive through lazy Error stacks.
User Impact
Repeated reloads can release the caller retained by a cached diagnostic while preserving the original Error, message, code and cause.
This is one layer of a partial memory repair: the combined ESM forced-GC endurance result is still 36.65 MiB against a 32 MiB limit (failed).
Why This Change Was Made
Materialize cached stacks as text at the cache owner, including throwing or structured custom formatters. The shared helper also handles retirement diagnostics and wrapped causes.
Evidence
11 cached-error collection cases failed before the first repair. Two custom-formatter cases then exposed the incomplete read-only approach. All 13 final cached-error GC regressions pass; six Node dependency probes confirm the assignment behavior.
Proof source:
6320346a6d281d4ab570cd67b241ec5d9a74ced8; the originally published stack top14a29985cfbc1b6f5e379b225ae7c00078061c16had the identical Git tree (bcdb4a87fb86add0a49982acf26af4568056f61b). The source-built live runs completed all four 20-warmup/500-measured lanes with functional checks passing and stable Gateway PID/socket. Real CLI install/reinstall auto-application and a separate physical shutdown/relaunch also passed. The 500-update trigger was source edits plus explicitplugins.reload; HTTP/tool checks were sampled, with full per-update tuples verified in the short diagnostics.Layer proof and reproduction commands · Before/after log excerpts · Live reload/restart measurements · Fresh review and commit provenance.
Fresh publication validation: P0–P2 cumulative review found no actionable defects. At publication, the stack plus main
b036baa80649passed 99 tests across 11 files, zero failed/skipped, including cache, registry-retention and state-lease owner/sibling coverage. The first integration attempt lacked package-local dependency links; the same command passed after restoring the existing links without an install or source changes. This combined-tree check supplements the exact-source build and live evidence above.Landing follow-up: two test-only corrections now distinguish retained task bytes from Vite source-map text and bundled companion reuse from installed-plugin capture. The paired reproductions passed 36/36 lifecycle tests and 8/8 companion cases; both scoped P0–P2 reviews and full changed-file gates passed. Production files are unchanged from the original published stack. CI repair proof and commands. Fresh hosted CI must pass on the corrected heads before landing.
Scope and limitations
Stack order (review bottom to top):