isDegradedLocalCatalog (sync-models/degradedLocalCatalog.ts)

OmniRoute · src/app/api/providers/[id]/sync-models/degradedLocalCatalog.ts · typescript · MIT
ai, tag:knn-classified

Utility functions to detect degraded catalog responses in model sync.

// Source: https://github.com/diegosouzapw/OmniRoute | License: MIT | Copyright 2026 diegosouzapw
// Provided via justclaw.it.com; keep this notice with the code.
/**
 * #5460 (Reka) + #5465 (t3.chat) — Distinguish a genuinely degraded
 * `local_catalog` models response (remote model discovery failed → the sync
 * route surfaces a 502) from a provider whose local catalog is its INTENDED and
 * only discovery source (reka, embedding/rerank providers like
 * voyage-ai/jina-ai, web-cookie providers like t3-web).
 *
 * The models route tags the latter with `intentional: true`. Before this guard,
 * model-sync 502'd on ANY `local_catalog` source, so the Import/Sync button
 * failed every single time for those providers even with a valid key/cookie.
 *
 * Dependency-free leaf so it can be unit-t

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key