perf(plugins): classify cached tool candidates once#96948
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed June 26, 2026, 5:38 PM ET / 21:38 UTC. Summary PR surface: Source +5. Total +5 across 1 file. Reproducibility: not applicable. this is a performance cleanup rather than a bug report. Source inspection confirms current main does two candidate-list filters, while PR head classifies the same candidates in one pass. Review metrics: none identified. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Keep the narrow one-pass classification shape, but merge only after redacted terminal output or logs show an after-fix cached descriptor-backed plugin tool resolving and executing in a real setup. Do we have a high-confidence way to reproduce the issue? Not applicable: this is a performance cleanup rather than a bug report. Source inspection confirms current main does two candidate-list filters, while PR head classifies the same candidates in one pass. Is this the best way to solve the issue? Yes for the code shape: one-pass classification is the narrowest maintainable change and preserves the existing execution order. Merge readiness still depends on contributor-supplied real behavior proof. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against a0e9ca1e9544. Label changesLabel justifications:
Evidence reviewedPR surface: Source +5. Total +5 across 1 file. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
a15dfe5 to
5de49e3
Compare
|
Merged via squash.
|
Co-authored-by: ly-wang19 <[email protected]>
Co-authored-by: ly-wang19 <[email protected]>
Co-authored-by: ly-wang19 <[email protected]>
Co-authored-by: ly-wang19 <[email protected]>
What Problem This Solves
Cached plugin descriptor execution scans the selected plugin tool candidates more than once when deciding which runtime registration should execute a requested tool. That path runs when a cached manifest descriptor needs to resolve the actual runtime tool implementation.
Why This Change Was Made
The code now classifies plugin tool candidates in one pass into matching named registrations and unnamed fallback registrations. It preserves the existing execution order: matching named candidates first, then unnamed candidates, with stable registry order inside each group.
User Impact
Plugin tool execution does less repeated candidate-list work on cached descriptor calls, especially for plugins with multiple tool registrations. Runtime behavior and fallback semantics are intended to stay unchanged.
Evidence