Repository navigation
improve(plugins): speed up repeated model catalog lookups - #139681
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. Reviewed September 5, 2026, 11:36 PM ET / September 6, 2026, 03:36 UTC. ClawSweeper reviewWhat this changesThe PR indexes plugin rules that hide unavailable models and prepares their matching conditions once, reducing repeated lookup work while preserving rule order. Merge readiness✅ Ready for maintainer review This remains a useful, focused optimization: current main still scans all suppression rules. No actionable correctness defect was found, and the maintainer-authored PR is protected from automatic closure. Priority: P2 Review scores
Verification
How this fits togetherPlugin manifests describe which models should be hidden or rejected. The suppression resolver combines those rules with the selected endpoint and current provider configuration for catalog filtering and direct model lookup. flowchart TD
A[Plugin manifest snapshot] --> B[Ordered suppression planner]
B --> C[Prepared per-model rule index]
D[Model lookup request] --> C
C --> E[Match current API and endpoint]
F[Provider configuration] --> E
E --> G[Suppression result or no match]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +22, Tests +74. Total +96 across 2 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep prepared rule indexes within the existing resolver lifetime while evaluating mutable route inputs at lookup time. Do we have a high-confidence way to reproduce the issue? Not applicable to a functional bug: this optimizes existing behavior. Source confirms repeated scanning and set construction on main; reported timing improvements were not rerun in this read-only review. Is this the best way to solve the issue? Yes. Preparing invariant metadata inside the existing cache owner removes repeated work without creating a parallel public API or freezing current route configuration. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 4ff90358328d. 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
Catalog filtering and direct model lookup repeatedly scanned every planned suppression rule and rebuilt normalized API and host sets for conditional matches.
Why This Change Was Made
Prepare ordered per-model buckets and immutable condition sets once in the existing snapshot/config-owned resolver. Current config and selected endpoints remain live inputs, preserving same-model precedence, unconditional lookups, and endpoint-scoped retirement behavior.
User Impact
Repeated model catalog lookups do less work. The resolver retains additional prepared metadata in exchange for reduced scanning and allocation during lookups; no retained-heap reduction is claimed.
Evidence
Full changed checks passed after incorporating the existing main branch shard rebalance. The rebased patch is byte-identical to the reviewed change.