Repository navigation
perf: speed up plugin package ownership checks - #136759
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed September 2, 2026, 8:28 PM ET / September 3, 2026, 00:28 UTC. ClawSweeper reviewWhat this changesThe PR shares realpath results within each plugin ownership scan and restores the existing missing-owner predicate without adding configuration or persistence. Merge readiness✅ Ready for maintainer review No blocking findings. The cache is scoped to each synchronous ownership scan, while current main still performs the repeated resolutions; this focused maintainer PR remains necessary. Priority: P3 Review scores
Verification
How this fits togetherPlugin management validates installed package ownership before registry refreshes, lifecycle actions, and management results proceed. It compares installation records with discovered plugin roots and returns valid, conflicting, or missing-owner outcomes. flowchart LR
A[Plugin management request] --> B[Installed plugin inventory]
B --> C[Ownership scan]
C --> D[Per-scan path resolution cache]
D --> E[Ownership decision]
E --> F[Registry or lifecycle result]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource 0. Total 0 across 1 file. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep the cache bounded to each synchronous scan, retaining fresh path observation for later lifecycle calls and the existing ownership test matrix. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR optimizes a synchronous ownership scan rather than reporting a user-facing failure. Current source directly establishes the bounded cache lifetime. Is this the best way to solve the issue? Yes. The ownership scan owns the repeated physical-path facts; a scan-local map removes redundant work without a process-wide stale-path cache, and later calls receive a fresh map. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 6d8ae28a755e. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
What Problem This Solves
Plugin management listings repeatedly resolve the same installed package path while checking it against the installed inventory. With the bundled inventory present, this adds milliseconds to each prepared listing.
Why This Change Was Made
Reuse the existing realpath helper's map within each synchronous ownership scan, then discard it. The strict package check, lifecycle/orphan check and missing-owner check each retain their own scope. Later calls still observe replaced paths; failed realpath lookups remain uncached.
This also returns the existing missing-owner predicate directly. Production LOC is +16/-16 (net zero); no test or configuration surface is added.
User Impact
Faster plugin management listings with the same package ownership decisions, errors, order and returned identities. No process-wide cache, persistence change or new setting.
Evidence
pnpm checkpassed; independent Codex source review found no actionable P0–P2 findings.The small installed-only control was +2.02% (+1.17 µs) forward and -11.45% reverse; retained without resampling. Single first-call observations also retain +20.14% on the installed-only control (forward) and +4.29% on the bundled-only control (reverse); these are individual observations, not measured medians. Kernel peak RSS was +0.95% / +0.76%. Both primaries and all protected controls passed the predeclared gates.
These are whole prepared-management-call measurements, not cold CLI, Gateway, network or model-turn latency claims. Setup/import time remains outside each call and inside the bounded host. The original harness attempt stopped before product imports because of a native environment assertion; its evidence and resource charges remain retained. The fresh successor preserves the original rows, counts, gates and caps.