mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-30 02:14:43 +08:00
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:
@@ -257,6 +257,7 @@ fn known_text_only_model(model: &str) -> bool {
|
||||
"kat-coder-pro-v1",
|
||||
"kat-coder-pro-v2",
|
||||
"ling-2.5-1t",
|
||||
"longcat-2.0",
|
||||
"longcat-flash-chat",
|
||||
"mimo-v2.5-pro",
|
||||
"us.deepseek.r1-v1",
|
||||
@@ -484,6 +485,15 @@ mod tests {
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn longcat_models_are_classified_text_only() {
|
||||
// LongCat-2.0 (like the retired Flash Chat) is a text-only model; the
|
||||
// preset ships it in mixed case, so the classifier must normalize first.
|
||||
assert!(known_text_only_model("LongCat-2.0"));
|
||||
assert!(known_text_only_model("longcat/LongCat-2.0"));
|
||||
assert!(known_text_only_model("LongCat-Flash-Chat"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn explicit_text_modalities_replace_images_before_send() {
|
||||
let provider = provider(json!({
|
||||
|
||||
Reference in New Issue
Block a user