Update Longcat presets to LongCat-2.0 (#4838)

* Update Longcat presets to LongCat-2.0

* fix(proxy): classify LongCat-2.0 as text-only for media sanitizer

The Longcat presets now use LongCat-2.0, but the known_text_only_model
allowlist still only matched the retired longcat-flash-chat tail. Without
this, images pasted into a text-only LongCat-2.0 session are forwarded
upstream instead of being replaced with the unsupported-image marker,
causing a hard rejection. Add longcat-2.0 (keeping the retired name for
saved configs) and a regression test.

---------

Co-authored-by: chengzifeng <chengzifeng@meituan.com>
Co-authored-by: Jason <farion1231@gmail.com>
This commit is contained in:
Cheng Zi Feng
2026-07-04 16:38:35 +08:00
committed by GitHub
parent 0cda8d46c7
commit 7a8b956253
11 changed files with 195 additions and 29 deletions
+7 -4
View File
@@ -1054,12 +1054,15 @@ export const opencodeProviderPresets: OpenCodeProviderPreset[] = [
npm: "@ai-sdk/openai-compatible",
name: "Longcat",
options: {
baseURL: "https://api.longcat.chat/v1",
baseURL: "https://api.longcat.chat/openai/v1",
apiKey: "",
setCacheKey: true,
},
models: {
"LongCat-Flash-Chat": { name: "LongCat Flash Chat" },
"LongCat-2.0": {
name: "LongCat 2.0",
options: { thinking: { type: "disabled" } },
},
},
},
category: "cn_official",
@@ -1068,8 +1071,8 @@ export const opencodeProviderPresets: OpenCodeProviderPreset[] = [
templateValues: {
baseURL: {
label: "Base URL",
placeholder: "https://api.longcat.chat/v1",
defaultValue: "https://api.longcat.chat/v1",
placeholder: "https://api.longcat.chat/openai/v1",
defaultValue: "https://api.longcat.chat/openai/v1",
editorValue: "",
},
apiKey: {