From 3538b392462ed22890a44dc8c55df0f1066ee119 Mon Sep 17 00:00:00 2001 From: Salar <126340046+salarkhannn@users.noreply.github.com> Date: Thu, 9 Jul 2026 05:36:54 +0500 Subject: [PATCH] feat(claude): add 1M checkbox to fallback model field (#5124) The fallback model (ANTHROPIC_MODEL) field was missing the 1M checkbox that the role-specific model rows already have. Added the checkbox with the same strip/set marker logic used by role rows. Fixes #3679 --- .../providers/forms/ClaudeFormFields.tsx | 36 +++++++++++++++---- 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/src/components/providers/forms/ClaudeFormFields.tsx b/src/components/providers/forms/ClaudeFormFields.tsx index 7c341d3cc..57ee93883 100644 --- a/src/components/providers/forms/ClaudeFormFields.tsx +++ b/src/components/providers/forms/ClaudeFormFields.tsx @@ -247,6 +247,7 @@ export function ClaudeFormFields({ const [codexOauthModels, setCodexOauthModels] = useState([]); const [codexOauthModelsLoading, setCodexOauthModelsLoading] = useState(false); const codexOauthModelsRequestRef = useRef(0); + const fallbackUsesOneM = hasClaudeOneMMarker(claudeModel); // 通用模型获取(非 Copilot 供应商) const [fetchedModels, setFetchedModels] = useState([]); @@ -985,12 +986,35 @@ export function ClaudeFormFields({ defaultValue: "默认兜底模型", })} - {renderModelInput( - "claudeModel", - claudeModel, - "ANTHROPIC_MODEL", - t("providerForm.modelPlaceholder", { defaultValue: "" }), - )} +
+ {renderModelInput( + "claudeModel", + stripClaudeOneMMarker(claudeModel), + "ANTHROPIC_MODEL", + t("providerForm.modelPlaceholder", { defaultValue: "" }), + (value) => + onModelChange( + "ANTHROPIC_MODEL", + setClaudeOneMMarker(value, fallbackUsesOneM), + ), + )} + +

{t("providerForm.fallbackModelHint", { defaultValue: