Skip to content

chore(catalog): purge legacy BazaarLink imports, hide disabled models from Model Status - #7

Merged
aliihsaad merged 1 commit into
mainfrom
chore/purge-unusable-models
Jul 22, 2026
Merged

chore(catalog): purge legacy BazaarLink imports, hide disabled models from Model Status#7
aliihsaad merged 1 commit into
mainfrom
chore/purge-unusable-models

Conversation

@aliihsaad

Copy link
Copy Markdown
Owner

Model Status showed 304 Unknown models — mostly BazaarLink text-to-image/video generators (wan2.1-t2i, happyhorse, Z-Image-Turbo) that can never serve chat.

What happened

On 2026-07-20 20:53–20:54 the scout pulled BazaarLink's entire ~260-model catalog in three MAX_DISCOVERED_PER_PLATFORM batches (100 + 100 + 45), before the chat filter existed. They landed disabled, so nothing could route to them — but they inflated the catalog and the status counters.

Not an ongoing issue: isBazaarlinkFreeChatEntry now rejects them at discovery — verified against BazaarLink's live catalog, 2 of 260 pass (auto:free, deepseek/deepseek-v4-flash:free). This clears the historical residue only.

The purge

purgeLegacyBazaarlinkDiscoveries is scoped deliberately narrowly so it can't eat anything real:

  • bazaarlink only — other providers import catalogs by design
  • disabled only — never touches something in use
  • auto-discovered only — seeded/curated rows have no discovery_source
  • before the cutoff — a later discovery an operator chooses to disable is never swept up

fallback_config is ON DELETE NO ACTION so it's cleared first; model_availability / model_capabilities / model_runtime_health cascade. Idempotent, and a no-op on a fresh install.

Model Status now hides disabled models

They cannot be routed to and are never live-checked, so counting them as "unknown" was misleading. Behind a Show disabled (N) toggle.

Result (live)

before after
total models 578 333
bazaarlink rows 259 14 (all enabled)
Unknown counter 304 19

Kept: auto:free, deepseek/deepseek-v4-flash:free, and all seeded chat models.

Tests: 238/238 (3 new — deletion, protection of enabled/seeded/later-discovered/other-provider rows, idempotency). Build green. DB backed up locally before running.

… from Model Status

On 2026-07-20 the scout pulled BazaarLink's entire ~260-model catalog in
MAX_DISCOVERED_PER_PLATFORM batches — ~245 text-to-image/video models
(wan2.1-t2i, happyhorse, Z-Image-Turbo) and paid chat models that can never
serve /v1/chat/completions. They landed disabled, so nothing could route to
them, but they inflated the catalog and the Model Status counters.

isBazaarlinkFreeChatEntry already rejects them at discovery (verified against
the live catalog: 2 of 260 pass), so this only clears the historical residue.
purgeLegacyBazaarlinkDiscoveries is scoped narrowly — bazaarlink only, disabled
only, auto-discovered only, and only discoveries before the cutoff — so a later
discovery an operator deliberately disables is never swept up. fallback_config
is ON DELETE NO ACTION and is cleared first; the rest cascade.

Model Status now hides disabled models (they cannot be routed to and are never
live-checked, so counting them as 'unknown' was misleading) behind a
'Show disabled (N)' toggle.

Live result: 578 -> 333 models, bazaarlink 259 -> 14 (all enabled), Unknown
304 -> 19. auto:free, deepseek-v4-flash:free and the seeded chat models kept.
@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@aliihsaad, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 8 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d84e1aab-82aa-4671-809d-aafdd53efb86

📥 Commits

Reviewing files that changed from the base of the PR and between 253bdf9 and 1d24258.

⛔ Files ignored due to path filters (5)
  • client/dist/index.html is excluded by !**/dist/**
  • server/dist/db/index.d.ts is excluded by !**/dist/**
  • server/dist/db/index.d.ts.map is excluded by !**/dist/**, !**/*.map
  • server/dist/db/index.js is excluded by !**/dist/**
  • server/dist/db/index.js.map is excluded by !**/dist/**, !**/*.map
📒 Files selected for processing (3)
  • client/src/pages/ModelStatusPage.tsx
  • server/src/__tests__/db/purge-legacy-discoveries.test.ts
  • server/src/db/index.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/purge-unusable-models

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@aliihsaad
aliihsaad merged commit efb8546 into main Jul 22, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant