From 44ba9468b566358bd477c05c87123a5f59c63938 Mon Sep 17 00:00:00 2001 From: Jason Date: Sun, 8 Feb 2026 21:40:51 +0800 Subject: [PATCH] refactor(openclaw): move model detail fields into advanced options Keep only model ID and display name visible by default, collapse context window, max tokens, reasoning, and cost fields into the advanced options section. --- .../providers/forms/OpenClawFormFields.tsx | 219 +++++++++--------- 1 file changed, 110 insertions(+), 109 deletions(-) diff --git a/src/components/providers/forms/OpenClawFormFields.tsx b/src/components/providers/forms/OpenClawFormFields.tsx index a2d6501f9..bb4a26770 100644 --- a/src/components/providers/forms/OpenClawFormFields.tsx +++ b/src/components/providers/forms/OpenClawFormFields.tsx @@ -277,111 +277,6 @@ export function OpenClawFormFields({ - {/* Context Window, Max Tokens and Reasoning row */} -
-
- - - handleModelChange( - index, - "contextWindow", - e.target.value ? parseInt(e.target.value) : undefined, - ) - } - placeholder="200000" - /> -
-
- - - handleModelChange( - index, - "maxTokens", - e.target.value ? parseInt(e.target.value) : undefined, - ) - } - placeholder="32000" - /> -
-
- -
- - handleModelChange(index, "reasoning", checked) - } - /> - - {model.reasoning - ? t("openclaw.reasoningOn", { defaultValue: "启用" }) - : t("openclaw.reasoningOff", { - defaultValue: "关闭", - })} - -
-
- {/* Spacer for alignment with delete button */} -
-
- - {/* Basic Cost row */} -
-
- - - handleCostChange(index, "input", e.target.value) - } - placeholder="3" - /> -
-
- - - handleCostChange(index, "output", e.target.value) - } - placeholder="15" - /> -
- {/* Spacer for alignment */} -
-
-
- {/* Advanced Options (Collapsible) */} - + + {/* Context Window, Max Tokens and Reasoning row */} +
+
+ + + handleModelChange( + index, + "contextWindow", + e.target.value + ? parseInt(e.target.value) + : undefined, + ) + } + placeholder="200000" + /> +
+
+ + + handleModelChange( + index, + "maxTokens", + e.target.value + ? parseInt(e.target.value) + : undefined, + ) + } + placeholder="32000" + /> +
+
+ +
+ + handleModelChange(index, "reasoning", checked) + } + /> + + {model.reasoning + ? t("openclaw.reasoningOn", { + defaultValue: "启用", + }) + : t("openclaw.reasoningOff", { + defaultValue: "关闭", + })} + +
+
+
+ + {/* Cost row */} +
+
+ + + handleCostChange(index, "input", e.target.value) + } + placeholder="3" + /> +
+
+ + + handleCostChange(index, "output", e.target.value) + } + placeholder="15" + /> +
+
+
+ + {/* Cache Cost row */}
- {/* Spacer for alignment */}
-
-

+

{t("openclaw.cacheCostHint", { defaultValue: "缓存价格用于计算 Prompt Caching 的成本。如不使用缓存可留空。",