Repository navigation
improve(gateway): skip unconfigured model catalog startup work - #127117
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 21, 2026, 4:51 AM ET / 08:51 UTC. ClawSweeper reviewWhat this changesThe PR avoids unneeded Gateway startup catalog work by collecting configured agent model references first, filtering catalog planning to those providers and models, and separating refresh configuration from network-refresh code. Merge readinessKeep open for normal maintainer review: current main still performs full catalog planning before discovering that no agent model is configured, while this branch moves the decision to the startup owner and scopes the resulting planner work. No blocking correctness finding was identified; the protected maintainer label and incomplete exact-head checks keep the merge disposition human-owned. Priority: P3 Review scores
Verification
Live VerificationCommand: Result: FAIL (partial) — step 2 Assertions:
How this fits togetherGateway startup chooses which plugin providers must load from configured agent model references. It consults plugin manifest catalog metadata and optional stored remote overlays to resolve provider APIs before activating the corresponding plugin runtimes. flowchart LR
A[Gateway configuration] --> B[Configured agent model references]
B --> C[Startup provider collector]
C --> D[Scoped catalog planner]
E[Stored remote catalog overlay] --> D
D --> F[Provider API ownership]
F --> G[Plugin activation plan]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +47, Tests +172. Total +219 across 12 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the canonical planner filters and network-free refresh-config seam, then land only after maintainer review confirms the clean merge result and exact-head checks. Do we have a high-confidence way to reproduce the issue? Yes, from source: current main calls full catalog planning before scanning configured model references, and the branch's focused test makes that unnecessary inspection observable with a throwing getter. Is this the best way to solve the issue? Yes. Filtering at the canonical catalog planner preserves the unscoped callers while allowing the Gateway startup owner to avoid catalog normalization it cannot use. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 32fb2fc766f8. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
b0b73a8 to
6572c41
Compare
|
Land-ready proof for exact head
ClawSweeper disposition: the completed patch-equivalent review reported no actionable findings. Its before-merge moves are satisfied: exact-head CI is now complete, the clean native prepare gate passed, and this maintainer-owned landing is using the required native workflow. Its optional rank-up move (complete exact-head CI) is also satisfied. A newer exact-head ClawSweeper run currently has only an in-progress placeholder and has published no additional findings; under the late-publisher policy that does not block the otherwise complete exact-head proof. |
|
Merged via squash.
|
Co-authored-by: Amp <[email protected]>
What Problem This Solves
Gateway startup planned and normalized the complete plugin-owned model catalog before checking whether any agent model was configured. An empty configuration therefore traversed every manifest model and pulled remote-refresh networking into the startup import graph without using those results.
Why This Change Was Made
The startup collector now gathers configured default and per-agent model references first, returns immediately when none exist, and scopes the canonical catalog planner by normalized provider and merge key. Provider and model filtering happens before normalization, and remote overlay access is provider-scoped. Pure refresh enablement/URL configuration moved to a network-free module so startup planning no longer imports remote refresh machinery.
Aliases and overrides, trusted transport fields, remote overlay identity, pricing, and full unscoped catalog behavior remain unchanged. No provider-specific branch, cache, configuration option, protocol, or public API was added.
User Impact
Gateways with few or no configured agent models avoid unrelated plugin catalog normalization during startup. In the synthetic current-main workload, 2,000 empty-config calls improved from 2,042.56 ms total to a 2.82 ms median total (723×, 99.86%). The broad startup suite also reduced max RSS from 536,256 KB to 390,300 KB, though the focused benchmark is the primary evidence.
Evidence
remote-refresh.ts; overlay graph shrank from 185 to 156 modules and excludes bothremote-refresh.tsandfetch-guard.ts.node scripts/check-changed.mjs -- <12 changed paths>passed all routed checks, typechecks, lint, import-cycle and architecture guards.pnpm buildpassed, including postbuild and SDK/UI checks.git diff --checkpassed.AI-assisted implementation and verification. The change and its owner boundaries were reviewed; no agent transcript is attached because transcript publication was not authorized.