From 9476290c4bea5fbc3612c4966b85771a7aa6fb36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BE=B7=E5=AE=87?= Date: Sun, 4 Oct 2026 16:00:33 +0800 Subject: [PATCH] =?UTF-8?q?refactor(LLM):=20=E5=88=97=E8=A1=A8=E6=97=A0?= =?UTF-8?q?=E5=8F=AF=E7=94=A8=E6=A8=A1=E5=9E=8B=E6=97=B6=E5=A4=8D=E7=94=A8?= =?UTF-8?q?=20AgcModelResolveError=20=E7=9A=84=E9=94=99=E8=AF=AF=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - public_model_catalog 里硬编码的 MODEL_UNAVAILABLE 与 AgcModelResolveError::Unavailable.code() 重复 - 改为直接取枚举 code(),与 MODEL_ACCESS_UNAVAILABLE 的既有做法一致,避免两处字符串漂移 --- server-rs/crates/api-server/src/llm/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server-rs/crates/api-server/src/llm/mod.rs b/server-rs/crates/api-server/src/llm/mod.rs index 28c275fb8..b12bbb318 100644 --- a/server-rs/crates/api-server/src/llm/mod.rs +++ b/server-rs/crates/api-server/src/llm/mod.rs @@ -281,7 +281,7 @@ fn public_model_catalog( .default_model_id_for(access) .ok_or_else(|| { AppError::from_status(StatusCode::SERVICE_UNAVAILABLE) - .with_code("MODEL_UNAVAILABLE") + .with_code(AgcModelResolveError::Unavailable.code()) .with_message("当前会员档位没有可用模型") })? .to_string();