fix: restore live route quarantine migration

This commit is contained in:
wlx committed 2026-09-28 06:48:23 +08:00
1 parent 4cd7012788
commit 144b6b41d2
1 file changed
+81
@@ -0,0 +1,81 @@
-- Keep the public catalog honest after the 2026-09-28 live acceptance run.
-- These routes returned a deterministic "no available channel" response from
-- the named upstream. They remain soft-disabled and editable in the admin
-- catalog so an operator can re-enable them after the upstream adds a channel.
UPDATE model_catalog AS m
SET status = 'disabled', updated_at = now()
FROM model_providers AS p
WHERE m.provider_id = p.id
AND p.code = 'apipro'
AND p.deleted_at IS NULL
AND (m.source_label = 'APIPro' OR (m.source_label = 'APIPro · claude-fable-5' AND m.upstream_model = 'claude-fable-5'))
AND m.upstream_model IN (
'Moonshot-Kimi-K2-Instruct',
'claude-fable-5',
'claude-haiku-4-5-20251001-thinking',
'claude-opus-4-1-20250805',
'claude-opus-4-1-20250805-thinking',
'claude-opus-4-20250514',
'claude-opus-4-20250514-thinking',
'claude-opus-4-5-20251101-thinking',
'claude-sonnet-4-20250514-thinking',
'doubao-seed-1-6-lite-251015',
'gemini-3-flash',
'glm-4.7',
'gpt-4.1-nano-2025-04-14',
'gpt-5-chat',
'gpt-5-chat-latest',
'gpt-5-nano-2025-08-07',
'gpt-5-codex',
'gpt-5.1-codex',
'gpt-5.2-codex',
'gpt-5.3-codex',
'gpt-5.2-pro',
'gpt-5.4-pro',
'gpt-5.5-pro',
'kimi-k2-thinking',
'kimi-k2.5',
'kimi-k2.7-code',
'minimax-m2.7'
)
AND m.status = 'active'
AND m.deleted_at IS NULL;
-- TokenFoundryX's playground reports claude-fable-5 as having no available
-- channel. The source label is constrained so another provider's route is kept.
UPDATE model_catalog AS m
SET status = 'disabled', updated_at = now()
FROM model_providers AS p
WHERE m.provider_id = p.id
AND p.code = 'tokenfoundryx'
AND p.deleted_at IS NULL
AND m.source_label IN ('TokenFoundryX 海外', 'TokenFoundryX')
AND m.upstream_model = 'claude-fable-5'
AND m.status = 'active'
AND m.deleted_at IS NULL;
-- Wildcard aliases are catalog placeholders rather than stable model IDs.
-- Generic errors, timeouts, rate limits and credit failures are deliberately
-- left active until a fresh probe confirms a deterministic unavailable route.
UPDATE model_catalog AS m
SET status = 'disabled', updated_at = now()
FROM model_providers AS p
WHERE m.provider_id = p.id
AND p.code = 'apipro'
AND p.deleted_at IS NULL
AND m.source_label = 'APIPro'
AND m.upstream_model LIKE '%*'
AND m.status = 'active'
AND m.deleted_at IS NULL;
-- The current public gateway only accepts text chat messages and has no OCR
-- executor. Do not publish a route that can only succeed with an image input.
UPDATE model_catalog AS m
SET status = 'disabled', updated_at = now()
FROM model_providers AS p
WHERE m.provider_id = p.id
AND p.code = 'apipro'
AND p.deleted_at IS NULL
AND m.upstream_model = 'deepseek-ocr'
AND m.status = 'active'
AND m.deleted_at IS NULL;