Repository navigation
perf(skills): avoid repeated placement scans during batch deletion - #26223
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review. 📝 WalkthroughWalkthrough
Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to The deletion-planning change appears mergeable after normal checks. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ELI5
Deleting several skills made Orca repeatedly check every discovered placement for each selected skill. Preparation now groups placements once, so it checks only the ones that can belong to each selected skill.
What Changed
The deletion planner indexes its freshly discovered candidates by the existing host-specific file or directory identity. It merges matching candidates in their original order, then runs the existing ownership, eligibility, and deduplication checks. Preview and deletion both use this planner.
Why
The old loop repeated root-containment work for unrelated candidates. Indexing this one discovery result removes that repeated work without a persistent cache or changes to filesystem freshness and deletion safeguards.
Seven alternating before/after runs of the actual complete planner on a generated local filesystem with 64 selected skills and 192 canonical/file-alias/directory-alias placements measured median preparation 65.639 ms → 14.228 ms. Classification calls dropped 12,288 → 192. The one-skill control measured 1.283 ms → 1.281 ms. These measure deletion preparation, not terminal typing latency.
Linked Issue
No existing issue; maintainer performance audit.
Visual Proof
N/A — preparation produces the same deletion preview and operation; only repeated internal work changes.
Testing
Two regressions cover a real filesystem batch with many unrelated placements, and mixed directory/file aliases with original ordering and false-identity traps. The batch regression fails on the original source.
ORCA_BACKGROUND_LAUNCH=1, using private generated files. Windows/WSL path cases use filesystem seams; they are not measurements on those operating systems. No app window or user skill was touched.pnpm tc, and zero new quality findings across 89 changed files. Hosted CI passed: repository guards, static analysis/typecheck, all five Node 24 test shards, relay integration, Ubuntu 22.04 persistence, and macOS/Windows packaging.Review
Independent review confirmed that index membership exactly matches the existing classifier's file-versus-directory predicate and normalization. Original candidate ordinals preserve first-root metadata and deduplication. The index lives only for one fresh plan; host execution and all authorization checks remain in their current owners. No remote protocol or provider-specific behavior changes.
Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
Only the planner and its existing test file change. Existing canonical content, alias handling, freshness refusals, and filesystem failure behavior are preserved.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)