Repository navigation
Conversation
Routing analytics flagged any mapping with a deactivatedAt as deactivated and unroutable, even when the date is more than a year out. Routing itself compares against the date, so those mappings still elect and serve traffic - the page dropped them from the score table while they were receiving requests. A deactivation is now only an exclusion once the date has passed, and a scheduled one is surfaced as a "deactivates <date>" badge alongside the stability badge only when it falls within the next 30 days. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Warning Review limit reached
Next review available in: 27 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
WalkthroughThe change centralizes mapping deactivation checks, updates routing analytics to distinguish past and future dates, and displays imminent scheduled deactivations in the dashboard. ChangesDeactivation status handling
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/api/src/routes/admin-routing-analytics.spec.ts`:
- Around line 43-76: Replace the catalogue-scanning findModelWithDeactivation
fixture with a controlled provider mapping and mocked clock that
deterministically represent effective past and scheduled future deactivation
cases. Update the affected tests to use these controlled fixtures for both
scenarios, avoiding dependence on models’ real deactivatedAt dates during module
initialization.
In `@ee/admin/src/app/routing-analytics/client.tsx`:
- Around line 202-210: Update formatDeactivationDate to pass timeZone: "UTC" in
the Intl date formatting options, preserving the existing en-US, short month,
and numeric day settings so ISO timestamps display their catalogue date
consistently.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 9f0388ce-7119-48af-b13a-3fe3fc10df56
📒 Files selected for processing (10)
apps/api/src/routes/admin-routing-analytics.spec.tsapps/api/src/routes/admin-routing-analytics.tsee/admin/src/app/routing-analytics/client.tsxpackages/shared/package.jsonpackages/shared/src/components/index.tsxpackages/shared/src/components/models-directory/all-models.tsxpackages/shared/src/components/models-directory/deactivation.spec.tspackages/shared/src/components/models-directory/deactivation.tspackages/shared/src/deactivation.spec.tspackages/shared/src/deactivation.ts
💤 Files with no reviewable changes (2)
- packages/shared/src/components/models-directory/deactivation.ts
- packages/shared/src/components/models-directory/deactivation.spec.ts
The fixture scanned the catalogue for a future-dated mapping and threw at module load if none existed, so the whole spec file would start failing once scheduled dates passed - unrelated to the route being correct. Assert the past/future rule over whichever dated mappings the catalogue carries instead. Also format the scheduled-deactivation badge in UTC: catalogue dates are UTC-midnight calendar dates, so viewers west of UTC saw the previous day. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Merge commits are not allowed on this repository
Problem
Routing Analytics marked every mapping carrying a
deactivatedAtasdeactivatedand unroutable — including dates far in the future.gpt-5.6-sol's Azure mapping deactivates on 2028-01-11, yet the page showed it as deactivated, dropped it from the score table (Score: —) and excluded it from the "Routable mappings" count, while it was demonstrably serving ~7% of that model's traffic.Routing itself has always compared against the date (
now > deactivatedAtinresolve-model-info.ts,chat.ts,models.ts,realtime/catalog.ts, …), so a scheduled deactivation never affected election or filtering. The analytics page was the only place treating a baredeactivatedAtas "deactivated", so what it reported disagreed with what the router actually did.Change
apps/api/src/routes/admin-routing-analytics.ts— a deactivation is only an exclusion reason once the date has passed. Scheduled mappings are routable again, get scored, and appear in the score-composition table.ee/admin— a scheduled deactivation is surfaced next to the stability badge asdeactivates <date>, but only when it falls within the next 30 days. Anything further out reads as an ordinary stable mapping, because it is one.packages/shared—isMappingDeactivatedmoved out of the React components barrel into@llmgateway/shared/deactivation(a backend can't import the components entry), joined byisDeactivationScheduledSoon+DEACTIVATION_NOTICE_DAYS. The old export path still works via a re-export, so no consumer changed.No OpenAPI change — the response shape is untouched.
Screenshots
Before — Azure flagged
deactivatedwith no score, despite a 2028 date:After — Azure is stable, scored (
-0.852) and sorted into place:Imminent deactivation —
kimi-k2.6, whosetogether-aimapping retires on Aug 19, keeps its stability badge and score and gains an amber notice:Verification
deactivatedreason, and a past-dated one is still excluded — it fails onmain.packages/sharedsuite (223 tests) covers the new notice-window helper.pnpm format+ fullpnpm buildclean; screenshots taken against a locally seeded stack.🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Bug Fixes