Repository navigation
improve: reduce plugin ownership allocations on large inventories - #167364
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. What this changesThis PR prepares plugin package paths once per synchronous ownership phase and skips impossible POSIX containment matches. Example: Startup and status inspect an inventory of 80 installed plugins.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR contains useful allocation reductions absent from main, with no actionable patch defect found; the previous review’s qualification clarification is addressed. Priority: P3 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe plugin ownership resolver consumes installed package records and discovered plugin roots, then supplies ownership, conflict, orphan, update, and reload decisions to inventory and lifecycle callers. flowchart TD
A[Installed package records] --> C[Synchronous ownership resolver]
B[Discovered plugin roots] --> C
C --> D[Prepared canonical paths]
D --> E[Canonical containment guard]
E --> F[Ownership and conflict results]
F --> G[Inventory and package lifecycle]
Technical reviewBest possible solution: Keep path preparation within the existing synchronous resolver and limit performance claims to the measured allocation savings. Do we have a high-confidence way to reproduce the issue? This is a performance improvement rather than a behavior defect; source confirms repeated path preparation, and the PR reports native startup and status measurements with 80 installed plugins. Is this the best way to solve the issue? Preparing paths within the existing resolver addresses repeated normalization without adding a competing containment owner or extending cache lifetime. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 207b7813aea9. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +17. Total +17 across 1 file. Added test files: 0. View PR surface stats
LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReviewed October 14, 2026, 9:41 PM ET / October 15, 2026, 01:41 UTC (Revision 3). |
a7320ff to
2984019
Compare
|
@clawsweeper re-review |
|
ClawSweeper reviews are opt-in for maintainers. If a review is required, finish the work and validation first, then comment |
|
🦞👀 Re-review progress:
|
What Problem This Solves
Plugin ownership checks repeatedly canonicalize the same paths while checking installed packages, creating avoidable startup and status-command allocations on large inventories.
User Impact
Reduces transient allocations for plugin-heavy startup and status checks. Ownership, update, uninstall, and containment rules are unchanged; no configuration or migration is required. Gateway peak-RSS improvement is not established.
Why This Change Was Made
Prepare each root and install record once within the existing synchronous ownership phase. Reject impossible canonical POSIX prefixes cheaply, while leaving actual containment and all Windows path rules with the existing path owner. A new phase still gets a fresh resolver after updates or yields.
Evidence
0b82c02587a301a6918856ad44d915122dbe6f77; the ownership module has the same SHA-256 (e643a2c7b4ca677f2e788cb227824269c8966cde170d9ac44325b8805a00d134) as the reviewed PR heada7320ff5da0b14231ec676d277806533113e8a7b. The run's workflow SHA is a different identity,2b988ee83444f08ccaf37aa5e98f370726c75f6e.fresh-install/onboarded-userwas blocked because the status CLI CPU confidence interval (116.8–204.2%) straddled its 200% ceiling.gateway-performance/many-bundled-pluginsfailed at 1,202 MiB peak RSS against the unchanged 1,177 MiB budget. The mock agent-turn scenario passed. The source-performance lane passed. No baseline comparison was recorded, so these failures cannot be attributed to this optimization or declared inherited. Linux/RSS qualification is not claimed, and no thresholds or baselines were changed.2984019b34229c55bc8a2f2fc5b10f01150732b5, five existing ownership/update/uninstall/service-reload files passed all 45 tests (pnpm test <five files> --maxWorkers=1, 168.16 s including 44.69 s compiler preparation; no new test/CI cost). The exact management reload subset, including bundled selection with a dormant install record, also passed 11/11 (pnpm test src/plugins/management-service.test.ts --maxWorkers=1 -t reload, 47.69 s; 8 unrelated cases excluded by the filter). Core typecheck, changed-file lint, formatting, andgit diff --checkpassed.No new tests, dependencies, cache lifetime, schema, retention, activation behavior, or public SDK changes.
Exact-head CI on
2984019b34229c55bc8a2f2fc5b10f01150732b5passed: run 38666737090, including the trusted aggregate gate. Fresh ClawSweeper review is platinum, ready for maintainer review, with no findings or remaining checklist items.