Repository navigation
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@clawsweeper review Please check registry/config snapshot ownership and invalidation of the retained fallback health routes, including transport-derived model IDs, endpoints, and headers. Account eligibility and shared rate-limit state remain live reads. Final head: |
|
🦞👀 Re-review progress:
|
|
Codex review: needs maintainer review before merge. What this changesThis PR reuses normalized fallback health routes within the selected plugin registry and captured configuration. Example: Three warm fallback runs with six configured candidates and three synthetic provider plugins.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-directed optimization addresses repeated preparation still present on main, and the final diff has no actionable correctness findings. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherFallback selection resolves candidate transports before consulting live account eligibility and shared rate limits; the resulting health facts determine candidate ordering. flowchart TD
A[Fallback candidates] --> B[Route resolver]
C[Registry and captured config] --> B
B --> D[Live account and rate limits]
D --> E[Ordered candidate attempts]
Technical reviewBest possible solution: Keep transport projections with the existing registry lifecycle, keyed by captured config and restricted to registry-owned metadata, while reading auth and health live. Do we have a high-confidence way to reproduce the issue? Main's outer fallback health path normalizes each candidate without registry-owned reuse, matching the supplied baseline work counts; no target code was executed during this read-only review. Is this the best way to solve the issue? The change uses the existing lifecycle owner, preserves standalone and mismatched-inventory resolution, and adds distinct regressions for warm reuse, saturation parity, config publication, registry replacement, and inventory isolation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 43ed271df4a1. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +35, Tests +229, Docs +7, Other +33. Total +304 across 7 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed November 19, 2026, 12:51 AM ET / 05:51 UTC (Revision 2). |
|
@clawsweeper re-review Please review final head aab9b17. The preceding review had zero open findings. A subsequent differential test exposed a scoped-inventory collision in the initial patch, now corrected: the ownership check reuses routes only for the selected registry's metadata. The interleaved-inventory regression failed on the first patch and passes now, while ordinary warm fallback runs retain zero activation calls. All 35 focused tests and the full check:changed gate pass; final Codex autoreview is clean through P2. The body contains refreshed final-head paired CPU/allocation measurements and A/A controls. Proof uses the real fallback runner and executable synthetic provider plugins; no live Gateway/model service was exercised. |
|
🦞👀 Re-review progress:
|
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
…law#201632) * perf: reuse registry-owned fallback health routes * fix(agents): bind fallback routes to registry metadata ownership
* perf(agents): prepare fallback rate-limit routes with model snapshots Reuse configured fallback models within the admitted config snapshot and share provider handles across configured normalization hooks. Preserve cold resolution for standalone or mismatched snapshots and reload route facts with their owning snapshot. * fix(agents): preserve static model selection during fallback preparation Skip projection for agents without configured fallbacks. Match the production plugin-runtime scope in fallback benchmarks and regressions so both variants use the same retained registry. (cherry picked from commit 2b58c8e) Companion audit: #201632 is selected to preserve registry and metadata ownership for the fallback hot path. #200605, #203901, #203095 and #202618 make independent TUI, custody, module separation and model listing changes; none is required by this port. Co-authored-by: RomneyDa <[email protected]>
* perf: reuse registry-owned fallback health routes * fix(agents): bind fallback routes to registry metadata ownership (cherry picked from commit 11b6559) Release adaptation: Keep the stable NormalizePluginId load-context hook alongside the registry-scoped fallback map. No later follow-up required. Co-authored-by: RomneyDa <[email protected]>
What Problem This Solves
Choosing a fallback model repeatedly prepares provider plugins just to read each candidate's shared rate-limit state. Long fallback chains repeat config normalization, auto-enable preparation, and registration-key calculation before every run, even when the config and registry have not changed.
User Impact
Fallback selection uses substantially less CPU and memory. Candidate ordering, account selection, rate-limit gates, and reload behavior stay the same. No configuration changes or migration are required.
Why This Change Was Made
Normal reply fallback runs before candidate-level model-runtime acquisition, so the existing prepared-snapshot route map does not cover this outer health read. The selected plugin registry's existing load context now retains normalized candidate routes per captured config, only when the caller uses the metadata owned by that registry. Scoped inspections selecting another inventory retain the existing resolution path. This preserves plugin-derived model IDs, endpoints, and headers; account eligibility and current rate limits are still read on every run. Config publication, registry replacement, and existing context rebinding select fresh facts. Mutable setup inputs retain the existing uncached behavior.
The production delta is +35 lines for this lifecycle-owned projection; there is no new global or request-keyed cache. Existing prepared-snapshot consumers continue to carry their routes directly.
Evidence
The executable synthetic plugin regression fails on the base with 18 auto-enable calls across three warm six-candidate runs; the fix makes zero auto-enable, config-normalization, registration-key, or model-normalization calls. Differential tests preserve candidate ordering, skipped-attempt records, and final-attempt eligibility as all six routes become saturated, including plugin transport rewrites. Config republication and registry replacement select fresh routes. Interleaved inspection inventories with different transport endpoints cannot borrow each other's routes.
Five alternating before/after pairs, each with 500 measured runs after 100 warmups, using 48 plugin entries, three executable providers, one configured channel, and six fallback candidates:
Cold first-run wall time was 85.4 ms versus 81.0 ms. The final A/A control showed a 2.3% CPU shift and 0.21% allocation shift; the improvement is well beyond that variation. Timing, allocation, and work-count passes ran separately. This synthetic metadata/health path does not access session databases or enumerate workspaces.
Reproduce with
node --expose-gc --import ./scripts/tsx.mjs scripts/perf/model-fallback-activation-inputs.ts --flow registry-runner --config published --iterations 500 --warmup 100, adding--allocationor--countsin separate processes.35 focused tests passed, covering fallback activation, prepared and registry-owned routes, shared rate-limit and sticky behavior, plugin load context, and prompt-prefix stability. Codex autoreview is clean through P2. The changed modules have no Control UI imports.
pnpm check:changed --base 67aacbb676e55db620f56fbdb5132726d69ff512passed on the final patch, including all guards, typechecks, and lint. Final staged Codex autoreview is clean through P2. There are no unresolved local failures.CI qualification
Final-head CI run 44467659599 completed with one inherited failure:
checks-ui-e2e (1/2), the Plugins first-visit asset bound (57 assets versus a limit of 56). Every other selected job passed, including all Node shards andsecurity-fast; the aggregate gate is red because of that UI case.The same case fails on the exact CI main parent
43ed271df4a1bc109d8fe07c502985f40c116d6a. Attribution is 37e7af19884b4, #201620: its security-audit Tooltip import adds an asset. The immediate parent3b0b7e23f65fdpasses the same focused case; the introducing commit fails identically. This is a main regression requiring a separate owner repair, not a passing CI result. The entire UI tree and relevant test/build inputs are unchanged between the tested main parent and this PR merge.Reproduction at each unmodified checkout:
node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/route-asset-requests.e2e.test.ts -t 'bounds plugins ready-window asset requests' --maxWorkers=1.The scoped maintainer instruction permits pinned-head admin landing for exact-parent reproduced, commit-attributed inherited failures with green local proof. The native workflow retains that evidence. ClawSweeper reviewed final head
aab9b17faa964with zero findings and zero open items.