fix: preserve upstream routes pending protocol and live diagnosis

This commit is contained in:
wlx committed 2026-09-28 06:46:43 +08:00
1 parent 59907cebdf
commit 4cd7012788
1 file changed
-79
@@ -1,79 +0,0 @@
-- Keep the public catalog honest after the 2026-09-28 live acceptance run.
-- These routes returned a deterministic "no available channel"/unsupported
-- 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. Routes for the same logical model on another provider are 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 = 'apipro'
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.1-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 own playground currently reports these default-group routes
-- as "可用渠道不存在". Keep the successful TokenFoundryX routes visible and
-- quarantine only the models that failed the live probe.
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 m.source_label = 'TokenFoundryX 海外'
AND m.upstream_model IN (
'claude-fable-5'
)
AND m.status = 'active'
AND m.deleted_at IS NULL;
-- These aliases/wildcards are catalog placeholders rather than stable
-- OpenAI-compatible model IDs. A timeout or generic provider error is not
-- enough evidence to disable a real route, so only wildcard aliases and
-- deterministic "no available channel" results are quarantined here.
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 (
m.upstream_model LIKE '%*'
)
AND m.status = 'active'
AND m.deleted_at IS NULL;
-- OCR requires an image payload, but the current chat gateway intentionally
-- accepts text-only messages and the async executor has no OCR adapter. Keep
-- it editable in the admin catalog, but do not publish a route that cannot be
-- called successfully through the public API.
UPDATE model_catalog
SET status = 'disabled',
updated_at = now()
WHERE upstream_model = 'deepseek-ocr'
AND provider_id IN (SELECT id FROM model_providers WHERE code = 'apipro')
AND deleted_at IS NULL;