From 2d840926cd31c4284613256a9a0bc4991f701421 Mon Sep 17 00:00:00 2001 From: "Ton Hoang Nguyen (Bill)" <32552798+HahaBill@users.noreply.github.com> Date: Thu, 5 Jun 2025 02:11:14 +0100 Subject: [PATCH 01/20] feat: Adding UI and settings for the max context window - added `MaxContextWindowControl.tsx` - added maxContextWindow in `settings.json` --- packages/types/src/provider-settings.ts | 2 + .../src/components/settings/ApiOptions.tsx | 6 ++ .../settings/MaxContextWindowControl.tsx | 71 +++++++++++++++++++ webview-ui/src/i18n/locales/en/settings.json | 5 ++ 4 files changed, 84 insertions(+) create mode 100644 webview-ui/src/components/settings/MaxContextWindowControl.tsx diff --git a/packages/types/src/provider-settings.ts b/packages/types/src/provider-settings.ts index f5cf88fc27e..a7901147246 100644 --- a/packages/types/src/provider-settings.ts +++ b/packages/types/src/provider-settings.ts @@ -57,6 +57,7 @@ const baseProviderSettingsSchema = z.object({ diffEnabled: z.boolean().optional(), fuzzyMatchThreshold: z.number().optional(), modelTemperature: z.number().nullish(), + modelMaxContextWindow: z.number().nullish(), rateLimitSeconds: z.number().optional(), // Model reasoning. @@ -346,6 +347,7 @@ export const PROVIDER_SETTINGS_KEYS = keysOf()([ "diffEnabled", "fuzzyMatchThreshold", "modelTemperature", + "modelMaxContextWindow", "rateLimitSeconds", // Fake AI "fakeAi", diff --git a/webview-ui/src/components/settings/ApiOptions.tsx b/webview-ui/src/components/settings/ApiOptions.tsx index 905f34a8600..3ce3f63fd27 100644 --- a/webview-ui/src/components/settings/ApiOptions.tsx +++ b/webview-ui/src/components/settings/ApiOptions.tsx @@ -51,6 +51,7 @@ import { ApiErrorMessage } from "./ApiErrorMessage" import { ThinkingBudget } from "./ThinkingBudget" import { DiffSettingsControl } from "./DiffSettingsControl" import { TemperatureControl } from "./TemperatureControl" +import { MaxContextWindowControl } from "./MaxContextWindowControl" import { RateLimitSecondsControl } from "./RateLimitSecondsControl" import { BedrockCustomArn } from "./providers/BedrockCustomArn" import { buildDocLink } from "@src/utils/docLinks" @@ -484,6 +485,11 @@ const ApiOptions = ({ onChange={handleInputChange("modelTemperature", noTransform)} maxValue={2} /> + setApiConfigurationField("rateLimitSeconds", value)} diff --git a/webview-ui/src/components/settings/MaxContextWindowControl.tsx b/webview-ui/src/components/settings/MaxContextWindowControl.tsx new file mode 100644 index 00000000000..a0b4cf9efdd --- /dev/null +++ b/webview-ui/src/components/settings/MaxContextWindowControl.tsx @@ -0,0 +1,71 @@ +import { VSCodeCheckbox } from "@vscode/webview-ui-toolkit/react" +import { useEffect, useState } from "react" +import { useAppTranslation } from "@/i18n/TranslationContext" +import { useDebounce } from "react-use" + +import { Slider } from "@/components/ui" + +interface MaxContextWindowControlProps { + value: number | undefined | null + onChange: (value: number | undefined | null) => void + maxValue?: number // Some providers like OpenAI use 0-2 range. +} + +export const MaxContextWindowControl = ({ value, onChange, maxValue = 1000000 }: MaxContextWindowControlProps) => { + const { t } = useAppTranslation() + const [isCustomTemperature, setIsCustomTemperature] = useState(value !== undefined) + const [inputValue, setInputValue] = useState(value) + + useDebounce(() => onChange(inputValue), 50, [onChange, inputValue]) + + // Sync internal state with prop changes when switching profiles. + useEffect(() => { + const hasCustomTemperature = value !== undefined && value !== null + setIsCustomTemperature(hasCustomTemperature) + setInputValue(value) + }, [value]) + + return ( + <> +
+ { + const isChecked = e.target.checked + setIsCustomTemperature(isChecked) + + if (!isChecked) { + setInputValue(null) // Unset the temperature, note that undefined is unserializable. + } else { + setInputValue(value ?? 0) // Use the value from apiConfiguration, if set. + } + }}> + + +
+ {t("settings:maxContextWindow.description")} +
+
+ + {isCustomTemperature && ( +
+
+
+ setInputValue(value)} + /> + {inputValue} +
+
+ {t("settings:maxContextWindow.rangeDescription")} +
+
+
+ )} + + ) +} diff --git a/webview-ui/src/i18n/locales/en/settings.json b/webview-ui/src/i18n/locales/en/settings.json index 18b0a467f0a..de6dd5cb939 100644 --- a/webview-ui/src/i18n/locales/en/settings.json +++ b/webview-ui/src/i18n/locales/en/settings.json @@ -497,6 +497,11 @@ "description": "Controls randomness in the model's responses.", "rangeDescription": "Higher values make output more random, lower values make it more deterministic." }, + "maxContextWindow": { + "useCustom": "Use custom context max window", + "description": "Controls randomness in the model's responses.", + "rangeDescription": "Higher values make output more random, lower values make it more deterministic." + }, "modelInfo": { "supportsImages": "Supports images", "noImages": "Does not support images", From cd50c11729a1b594ad21f2014d88693df004dabd Mon Sep 17 00:00:00 2001 From: "Ton Hoang Nguyen (Bill)" <32552798+HahaBill@users.noreply.github.com> Date: Thu, 5 Jun 2025 02:22:54 +0100 Subject: [PATCH 02/20] feat: Tuning the setting specifically for Gemini --- packages/types/src/provider-settings.ts | 4 ++-- webview-ui/src/components/settings/ApiOptions.tsx | 14 +++++++++----- .../settings/MaxContextWindowControl.tsx | 10 +++++----- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/packages/types/src/provider-settings.ts b/packages/types/src/provider-settings.ts index a7901147246..988eb992072 100644 --- a/packages/types/src/provider-settings.ts +++ b/packages/types/src/provider-settings.ts @@ -57,7 +57,6 @@ const baseProviderSettingsSchema = z.object({ diffEnabled: z.boolean().optional(), fuzzyMatchThreshold: z.number().optional(), modelTemperature: z.number().nullish(), - modelMaxContextWindow: z.number().nullish(), rateLimitSeconds: z.number().optional(), // Model reasoning. @@ -153,6 +152,7 @@ const lmStudioSchema = baseProviderSettingsSchema.extend({ const geminiSchema = apiModelIdProviderModelSchema.extend({ geminiApiKey: z.string().optional(), googleGeminiBaseUrl: z.string().optional(), + modelMaxContextWindow: z.number().nullish(), }) const openAiNativeSchema = apiModelIdProviderModelSchema.extend({ @@ -319,6 +319,7 @@ export const PROVIDER_SETTINGS_KEYS = keysOf()([ // Gemini "geminiApiKey", "googleGeminiBaseUrl", + "modelMaxContextWindow", // OpenAI Native "openAiNativeApiKey", "openAiNativeBaseUrl", @@ -347,7 +348,6 @@ export const PROVIDER_SETTINGS_KEYS = keysOf()([ "diffEnabled", "fuzzyMatchThreshold", "modelTemperature", - "modelMaxContextWindow", "rateLimitSeconds", // Fake AI "fakeAi", diff --git a/webview-ui/src/components/settings/ApiOptions.tsx b/webview-ui/src/components/settings/ApiOptions.tsx index 3ce3f63fd27..0483982e029 100644 --- a/webview-ui/src/components/settings/ApiOptions.tsx +++ b/webview-ui/src/components/settings/ApiOptions.tsx @@ -485,11 +485,15 @@ const ApiOptions = ({ onChange={handleInputChange("modelTemperature", noTransform)} maxValue={2} /> - + + {selectedProvider === "gemini" && ( + + )} + setApiConfigurationField("rateLimitSeconds", value)} diff --git a/webview-ui/src/components/settings/MaxContextWindowControl.tsx b/webview-ui/src/components/settings/MaxContextWindowControl.tsx index a0b4cf9efdd..f7edb8e08fb 100644 --- a/webview-ui/src/components/settings/MaxContextWindowControl.tsx +++ b/webview-ui/src/components/settings/MaxContextWindowControl.tsx @@ -13,7 +13,7 @@ interface MaxContextWindowControlProps { export const MaxContextWindowControl = ({ value, onChange, maxValue = 1000000 }: MaxContextWindowControlProps) => { const { t } = useAppTranslation() - const [isCustomTemperature, setIsCustomTemperature] = useState(value !== undefined) + const [isCustomMaxContextWindow, setIsCustomMaxContextWindow] = useState(value !== undefined) const [inputValue, setInputValue] = useState(value) useDebounce(() => onChange(inputValue), 50, [onChange, inputValue]) @@ -21,7 +21,7 @@ export const MaxContextWindowControl = ({ value, onChange, maxValue = 1000000 }: // Sync internal state with prop changes when switching profiles. useEffect(() => { const hasCustomTemperature = value !== undefined && value !== null - setIsCustomTemperature(hasCustomTemperature) + setIsCustomMaxContextWindow(hasCustomTemperature) setInputValue(value) }, [value]) @@ -29,10 +29,10 @@ export const MaxContextWindowControl = ({ value, onChange, maxValue = 1000000 }: <>
{ const isChecked = e.target.checked - setIsCustomTemperature(isChecked) + setIsCustomMaxContextWindow(isChecked) if (!isChecked) { setInputValue(null) // Unset the temperature, note that undefined is unserializable. @@ -47,7 +47,7 @@ export const MaxContextWindowControl = ({ value, onChange, maxValue = 1000000 }:
- {isCustomTemperature && ( + {isCustomMaxContextWindow && (
From e6107170816a40021db316cbd7e4e536458acffc Mon Sep 17 00:00:00 2001 From: "Ton Hoang Nguyen (Bill)" <32552798+HahaBill@users.noreply.github.com> Date: Fri, 6 Jun 2025 00:46:55 +0100 Subject: [PATCH 03/20] feat: change the desciption and rangeDesription of `maxContextWindow` + modifying context window in context condensing for Gemini --- webview-ui/src/components/settings/ApiOptions.tsx | 2 +- .../src/components/settings/MaxContextWindowControl.tsx | 6 +++--- webview-ui/src/i18n/locales/en/settings.json | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/webview-ui/src/components/settings/ApiOptions.tsx b/webview-ui/src/components/settings/ApiOptions.tsx index 0483982e029..85c4f496d32 100644 --- a/webview-ui/src/components/settings/ApiOptions.tsx +++ b/webview-ui/src/components/settings/ApiOptions.tsx @@ -490,7 +490,7 @@ const ApiOptions = ({ )} diff --git a/webview-ui/src/components/settings/MaxContextWindowControl.tsx b/webview-ui/src/components/settings/MaxContextWindowControl.tsx index f7edb8e08fb..b4e9dd5793a 100644 --- a/webview-ui/src/components/settings/MaxContextWindowControl.tsx +++ b/webview-ui/src/components/settings/MaxContextWindowControl.tsx @@ -8,7 +8,7 @@ import { Slider } from "@/components/ui" interface MaxContextWindowControlProps { value: number | undefined | null onChange: (value: number | undefined | null) => void - maxValue?: number // Some providers like OpenAI use 0-2 range. + maxValue?: number } export const MaxContextWindowControl = ({ value, onChange, maxValue = 1000000 }: MaxContextWindowControlProps) => { @@ -52,10 +52,10 @@ export const MaxContextWindowControl = ({ value, onChange, maxValue = 1000000 }:
setInputValue(value)} /> {inputValue} diff --git a/webview-ui/src/i18n/locales/en/settings.json b/webview-ui/src/i18n/locales/en/settings.json index de6dd5cb939..57b5b2c7b35 100644 --- a/webview-ui/src/i18n/locales/en/settings.json +++ b/webview-ui/src/i18n/locales/en/settings.json @@ -498,9 +498,9 @@ "rangeDescription": "Higher values make output more random, lower values make it more deterministic." }, "maxContextWindow": { - "useCustom": "Use custom context max window", - "description": "Controls randomness in the model's responses.", - "rangeDescription": "Higher values make output more random, lower values make it more deterministic." + "useCustom": "Use custom max context window", + "description": "Sets the maximum context window size for the model. When conversations approach this limit, Roo Code will automatically condense older messages to stay within the constraint.", + "rangeDescription": "Higher values allow longer conversations before condensing, lower values trigger condensing sooner to stay within API rate limits." }, "modelInfo": { "supportsImages": "Supports images", From d18b3c9f3c40ebf1287cd12c25381cbfd989885c Mon Sep 17 00:00:00 2001 From: "Ton Hoang Nguyen (Bill)" <32552798+HahaBill@users.noreply.github.com> Date: Fri, 6 Jun 2025 00:47:43 +0100 Subject: [PATCH 04/20] feat: modelMaxContextWindow for context condensing --- src/core/task/Task.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/task/Task.ts b/src/core/task/Task.ts index 5683c2d9b21..51e632a1790 100644 --- a/src/core/task/Task.ts +++ b/src/core/task/Task.ts @@ -1623,7 +1623,10 @@ export class Task extends EventEmitter { ? this.apiConfiguration.modelMaxTokens || DEFAULT_THINKING_MODEL_MAX_TOKENS : modelInfo.maxTokens - const contextWindow = modelInfo.contextWindow + const contextWindow = + this.apiConfiguration.apiProvider === "gemini" && this.apiConfiguration.modelMaxContextWindow + ? this.apiConfiguration.modelMaxContextWindow + : modelInfo.contextWindow const truncateResult = await truncateConversationIfNeeded({ messages: this.apiConversationHistory, From 95a1440b1ced5007d3c7c5d620ea21dd9db346a2 Mon Sep 17 00:00:00 2001 From: "Ton Hoang Nguyen (Bill)" <32552798+HahaBill@users.noreply.github.com> Date: Fri, 6 Jun 2025 01:12:52 +0100 Subject: [PATCH 05/20] feat: maxContextWindow - languages translated --- webview-ui/src/i18n/locales/ca/settings.json | 5 +++++ webview-ui/src/i18n/locales/de/settings.json | 5 +++++ webview-ui/src/i18n/locales/es/settings.json | 5 +++++ webview-ui/src/i18n/locales/fr/settings.json | 5 +++++ webview-ui/src/i18n/locales/hi/settings.json | 5 +++++ webview-ui/src/i18n/locales/it/settings.json | 5 +++++ webview-ui/src/i18n/locales/ja/settings.json | 5 +++++ webview-ui/src/i18n/locales/ko/settings.json | 5 +++++ webview-ui/src/i18n/locales/nl/settings.json | 5 +++++ webview-ui/src/i18n/locales/pl/settings.json | 5 +++++ webview-ui/src/i18n/locales/pt-BR/settings.json | 5 +++++ webview-ui/src/i18n/locales/ru/settings.json | 5 +++++ webview-ui/src/i18n/locales/tr/settings.json | 5 +++++ webview-ui/src/i18n/locales/vi/settings.json | 5 +++++ webview-ui/src/i18n/locales/zh-CN/settings.json | 5 +++++ webview-ui/src/i18n/locales/zh-TW/settings.json | 5 +++++ 16 files changed, 80 insertions(+) diff --git a/webview-ui/src/i18n/locales/ca/settings.json b/webview-ui/src/i18n/locales/ca/settings.json index c0e36ad2563..0877d39f320 100644 --- a/webview-ui/src/i18n/locales/ca/settings.json +++ b/webview-ui/src/i18n/locales/ca/settings.json @@ -497,6 +497,11 @@ "description": "Controla l'aleatorietat en les respostes del model.", "rangeDescription": "Valors més alts fan que la sortida sigui més aleatòria, valors més baixos la fan més determinista." }, + "maxContextWindow": { + "useCustom": "Utilitza una finestra de context màxim personalitzada", + "description": "Estableix la mida màxima de la finestra de context per al model. Quan les converses s'acosten a aquest límit, Roo Code condensarà automàticament els missatges més antics per mantenir-se dins de la restricció.", + "rangeDescription": "Els valors més alts permeten converses més llargues abans de condensar-se, els valors més baixos activen la condensació abans per mantenir-se dins dels límits de velocitat de l'API." + }, "modelInfo": { "supportsImages": "Suporta imatges", "noImages": "No suporta imatges", diff --git a/webview-ui/src/i18n/locales/de/settings.json b/webview-ui/src/i18n/locales/de/settings.json index a3b87324adc..f8e9e944975 100644 --- a/webview-ui/src/i18n/locales/de/settings.json +++ b/webview-ui/src/i18n/locales/de/settings.json @@ -497,6 +497,11 @@ "description": "Steuert die Zufälligkeit in den Antworten des Modells.", "rangeDescription": "Höhere Werte machen die Ausgabe zufälliger, niedrigere Werte machen sie deterministischer." }, + "maxContextWindow": { + "useCustom": "Benutzerdefiniertes maximales Kontextfenster verwenden", + "description": "Legt die maximale Kontextfenstergröße für das Modell fest. Wenn Konversationen diese Grenze erreichen, komprimiert Roo Code ältere Nachrichten automatisch, um die Beschränkung einzuhalten.", + "rangeDescription": "Höhere Werte ermöglichen längere Gespräche vor der Verdichtung, niedrigere Werte lösen eine frühere Verdichtung aus, um innerhalb der API-Ratengrenzen zu bleiben." + }, "modelInfo": { "supportsImages": "Unterstützt Bilder", "noImages": "Unterstützt keine Bilder", diff --git a/webview-ui/src/i18n/locales/es/settings.json b/webview-ui/src/i18n/locales/es/settings.json index 3a1f5695c38..2a3271b3a52 100644 --- a/webview-ui/src/i18n/locales/es/settings.json +++ b/webview-ui/src/i18n/locales/es/settings.json @@ -497,6 +497,11 @@ "description": "Controla la aleatoriedad en las respuestas del modelo.", "rangeDescription": "Valores más altos hacen que la salida sea más aleatoria, valores más bajos la hacen más determinista." }, + "maxContextWindow": { + "useCustom": "Usar ventana de contexto máxima personalizada", + "description": "Establece el tamaño máximo de la ventana de contexto del modelo. Cuando las conversaciones se acercan a este límite, Roo Code condensará automáticamente los mensajes antiguos para ajustarse a la restricción.", + "rangeDescription": "Los valores más altos permiten conversaciones más largas antes de condensarse; los valores más bajos activan la condensación antes para permanecer dentro de los límites de velocidad de la API." + }, "modelInfo": { "supportsImages": "Soporta imágenes", "noImages": "No soporta imágenes", diff --git a/webview-ui/src/i18n/locales/fr/settings.json b/webview-ui/src/i18n/locales/fr/settings.json index 77dc6275d6d..2ab21d05ba9 100644 --- a/webview-ui/src/i18n/locales/fr/settings.json +++ b/webview-ui/src/i18n/locales/fr/settings.json @@ -497,6 +497,11 @@ "description": "Contrôle l'aléatoire dans les réponses du modèle.", "rangeDescription": "Des valeurs plus élevées rendent la sortie plus aléatoire, des valeurs plus basses la rendent plus déterministe." }, + "maxContextWindow": { + "useCustom": "Utiliser la fenêtre contextuelle maximale personnalisée", + "description": "Définit la taille maximale de la fenêtre contextuelle du modèle. Lorsque les conversations approchent de cette limite, Roo Code condense automatiquement les messages plus anciens pour respecter la contrainte.", + "rangeDescription": "Des valeurs plus élevées permettent des conversations plus longues avant la condensation, des valeurs plus faibles déclenchent la condensation plus tôt pour rester dans les limites de débit de l'API.." + }, "modelInfo": { "supportsImages": "Prend en charge les images", "noImages": "Ne prend pas en charge les images", diff --git a/webview-ui/src/i18n/locales/hi/settings.json b/webview-ui/src/i18n/locales/hi/settings.json index 5eebcaf9349..8688a0c64bc 100644 --- a/webview-ui/src/i18n/locales/hi/settings.json +++ b/webview-ui/src/i18n/locales/hi/settings.json @@ -497,6 +497,11 @@ "description": "मॉडल की प्रतिक्रियाओं में यादृच्छिकता को नियंत्रित करता है।", "rangeDescription": "उच्च मान आउटपुट को अधिक यादृच्छिक बनाते हैं, निम्न मान इसे अधिक निर्धारित बनाते हैं।" }, + "maxContextWindow": { + "useCustom": "कस्टम अधिकतम संदर्भ विंडो का उपयोग करें", + "description": "मॉडल के लिए अधिकतम संदर्भ विंडो आकार सेट करता है। जब बातचीत इस सीमा के करीब पहुंचती है, तो रू कोड पुराने संदेशों को स्वचालित रूप से सीमा के भीतर रहने के लिए संक्षिप्त कर देगा।", + "rangeDescription": "उच्चतर मान संघनन से पहले लम्बी बातचीत की अनुमति देते हैं, जबकि निम्न मान API दर सीमाओं के भीतर रहने के लिए शीघ्र ही संघनन को सक्रिय कर देते हैं।" + }, "modelInfo": { "supportsImages": "छवियों का समर्थन करता है", "noImages": "छवियों का समर्थन नहीं करता है", diff --git a/webview-ui/src/i18n/locales/it/settings.json b/webview-ui/src/i18n/locales/it/settings.json index 98669e7c5ef..24b572b3a59 100644 --- a/webview-ui/src/i18n/locales/it/settings.json +++ b/webview-ui/src/i18n/locales/it/settings.json @@ -497,6 +497,11 @@ "description": "Controlla la casualità nelle risposte del modello.", "rangeDescription": "Valori più alti rendono l'output più casuale, valori più bassi lo rendono più deterministico." }, + "maxContextWindow": { + "useCustom": "Utilizza la finestra di contesto massima personalizzata", + "description": "Imposta la dimensione massima della finestra di contesto per il modello. Quando le conversazioni si avvicinano a questo limite, Roo Code condensa automaticamente i messaggi più vecchi per rimanere entro il vincolo.", + "rangeDescription": "Valori più alti consentono conversazioni più lunghe prima della condensazione, mentre valori più bassi attivano la condensazione prima per restare entro i limiti di velocità API." + }, "modelInfo": { "supportsImages": "Supporta immagini", "noImages": "Non supporta immagini", diff --git a/webview-ui/src/i18n/locales/ja/settings.json b/webview-ui/src/i18n/locales/ja/settings.json index 2bacc6abafb..462fef2cd5e 100644 --- a/webview-ui/src/i18n/locales/ja/settings.json +++ b/webview-ui/src/i18n/locales/ja/settings.json @@ -497,6 +497,11 @@ "description": "モデルの応答のランダム性を制御します。", "rangeDescription": "高い値は出力をよりランダムに、低い値はより決定論的にします。" }, + "maxContextWindow": { + "useCustom": "カスタム最大コンテキストウィンドウを使用する", + "description": "モデルの最大コンテキストウィンドウサイズを設定します。会話がこの制限に近づくと、Roo Code は古いメッセージを自動的に圧縮して制限内に収めます。", + "rangeDescription": "値が大きいほど、圧縮前の会話が長くなり、値が小さいほど、API レート制限内に収まるように圧縮が早くトリガーされます。" + }, "modelInfo": { "supportsImages": "画像をサポート", "noImages": "画像をサポートしていません", diff --git a/webview-ui/src/i18n/locales/ko/settings.json b/webview-ui/src/i18n/locales/ko/settings.json index c9955832a87..0de658d64f6 100644 --- a/webview-ui/src/i18n/locales/ko/settings.json +++ b/webview-ui/src/i18n/locales/ko/settings.json @@ -497,6 +497,11 @@ "description": "모델 응답의 무작위성을 제어합니다.", "rangeDescription": "높은 값은 출력을 더 무작위하게, 낮은 값은 더 결정적으로 만듭니다." }, + "maxContextWindow": { + "useCustom": "사용자 정의 최대 컨텍스트 창 사용", + "description": "모델의 최대 컨텍스트 창 크기를 설정합니다. 대화가 이 제한에 도달하면 Roo Code는 자동으로 이전 메시지를 압축하여 제한 범위 내에 있도록 합니다.", + "rangeDescription": "값이 높을수록 응축되기 전에 더 긴 대화가 가능하고, 값이 낮을수록 API 속도 제한 내에 머물기 위해 더 빨리 응축이 실행됩니다." + }, "modelInfo": { "supportsImages": "이미지 지원", "noImages": "이미지 지원 안 함", diff --git a/webview-ui/src/i18n/locales/nl/settings.json b/webview-ui/src/i18n/locales/nl/settings.json index 83f057707b2..ee44b4b9e9c 100644 --- a/webview-ui/src/i18n/locales/nl/settings.json +++ b/webview-ui/src/i18n/locales/nl/settings.json @@ -497,6 +497,11 @@ "description": "Bepaalt de willekeurigheid in de antwoorden van het model.", "rangeDescription": "Hogere waarden maken de output willekeuriger, lagere waarden maken deze deterministischer." }, + "maxContextWindow": { + "useCustom": "Gebruik aangepast maximaal contextvenster", + "description": "Stelt de maximale grootte van het contextvenster voor het model in. Wanneer conversaties deze limiet naderen, condenseert Roo Code automatisch oudere berichten om binnen de beperking te blijven.", + "rangeDescription": "Hogere waarden zorgen voor langere conversaties voordat er condensatie plaatsvindt, lagere waarden activeren eerder condensatie om binnen de API-snelheidslimieten te blijven." + }, "modelInfo": { "supportsImages": "Ondersteunt afbeeldingen", "noImages": "Ondersteunt geen afbeeldingen", diff --git a/webview-ui/src/i18n/locales/pl/settings.json b/webview-ui/src/i18n/locales/pl/settings.json index 5d7611b2fdf..08abd2e15ac 100644 --- a/webview-ui/src/i18n/locales/pl/settings.json +++ b/webview-ui/src/i18n/locales/pl/settings.json @@ -497,6 +497,11 @@ "description": "Kontroluje losowość w odpowiedziach modelu.", "rangeDescription": "Wyższe wartości sprawiają, że wyjście jest bardziej losowe, niższe wartości czynią je bardziej deterministycznym." }, + "maxContextWindow": { + "useCustom": "Użyj niestandardowego okna maksymalnego kontekstu", + "description": "Ustawia maksymalny rozmiar okna kontekstu dla modelu. Gdy konwersacje zbliżają się do tego limitu, Roo Code automatycznie skondensuje starsze wiadomości, aby zachować ograniczenie.", + "rangeDescription": "Wyższe wartości umożliwiają dłuższe konwersacje przed kondensacją, niższe wartości uruchamiają kondensację wcześniej, aby utrzymać się w granicach szybkości interfejsu API." + }, "modelInfo": { "supportsImages": "Obsługuje obrazy", "noImages": "Nie obsługuje obrazów", diff --git a/webview-ui/src/i18n/locales/pt-BR/settings.json b/webview-ui/src/i18n/locales/pt-BR/settings.json index 0982fee7985..9aff7a71a9c 100644 --- a/webview-ui/src/i18n/locales/pt-BR/settings.json +++ b/webview-ui/src/i18n/locales/pt-BR/settings.json @@ -497,6 +497,11 @@ "description": "Controla a aleatoriedade nas respostas do modelo.", "rangeDescription": "Valores mais altos tornam a saída mais aleatória, valores mais baixos a tornam mais determinística." }, + "maxContextWindow": { + "useCustom": "Usar janela de contexto máximo personalizada", + "description": "Define o tamanho máximo da janela de contexto para o modelo. Quando as conversas se aproximam desse limite, o Roo Code condensa automaticamente as mensagens mais antigas para permanecer dentro da restrição.", + "rangeDescription": "Valores mais altos permitem conversas mais longas antes da condensação, valores mais baixos acionam a condensação mais cedo para permanecer dentro dos limites de taxa da API." + }, "modelInfo": { "supportsImages": "Suporta imagens", "noImages": "Não suporta imagens", diff --git a/webview-ui/src/i18n/locales/ru/settings.json b/webview-ui/src/i18n/locales/ru/settings.json index f427274cb0b..dfdabbcf214 100644 --- a/webview-ui/src/i18n/locales/ru/settings.json +++ b/webview-ui/src/i18n/locales/ru/settings.json @@ -497,6 +497,11 @@ "description": "Управляет случайностью ответов модели.", "rangeDescription": "Более высокие значения делают ответы более случайными, низкие — более детерминированными." }, + "maxContextWindow": { + "useCustom": "Использовать пользовательское максимальное контекстное окно", + "description": "Устанавливает максимальный размер контекстного окна для модели. Когда разговоры приближаются к этому пределу, Roo Code автоматически сжимает старые сообщения, чтобы оставаться в рамках ограничения.", + "rangeDescription": "Более высокие значения допускают более длительные разговоры перед сжатием, более низкие значения запускают сжатие раньше, чтобы оставаться в пределах ограничений скорости API." + }, "modelInfo": { "supportsImages": "Поддерживает изображения", "noImages": "Не поддерживает изображения", diff --git a/webview-ui/src/i18n/locales/tr/settings.json b/webview-ui/src/i18n/locales/tr/settings.json index 62dad574db6..60f0ed83801 100644 --- a/webview-ui/src/i18n/locales/tr/settings.json +++ b/webview-ui/src/i18n/locales/tr/settings.json @@ -497,6 +497,11 @@ "description": "Model yanıtlarındaki rastgeleliği kontrol eder.", "rangeDescription": "Daha yüksek değerler çıktıyı daha rastgele yapar, daha düşük değerler daha deterministik hale getirir." }, + "maxContextWindow": { + "useCustom": "Özel maksimum bağlam penceresini kullan", + "description": "Model için maksimum bağlam penceresi boyutunu ayarlar. Konuşmalar bu sınıra yaklaştığında, Roo Kodu kısıtlama dahilinde kalmak için eski mesajları otomatik olarak yoğunlaştıracaktır.", + "rangeDescription": "Daha yüksek değerler, yoğunlaşmadan önce daha uzun görüşmelere izin verirken, daha düşük değerler API oran sınırları içinde kalmak için daha erken yoğunlaşmayı tetikler." + }, "modelInfo": { "supportsImages": "Görüntüleri destekler", "noImages": "Görüntüleri desteklemez", diff --git a/webview-ui/src/i18n/locales/vi/settings.json b/webview-ui/src/i18n/locales/vi/settings.json index df6dc768b82..adcc21b7243 100644 --- a/webview-ui/src/i18n/locales/vi/settings.json +++ b/webview-ui/src/i18n/locales/vi/settings.json @@ -497,6 +497,11 @@ "description": "Kiểm soát tính ngẫu nhiên trong phản hồi của mô hình.", "rangeDescription": "Giá trị cao hơn làm cho đầu ra ngẫu nhiên hơn, giá trị thấp hơn làm cho nó xác định hơn." }, + "maxContextWindow": { + "useCustom": "Sử dụng cửa sổ ngữ cảnh tối đa tùy chỉnh", + "description": "Đặt kích thước cửa sổ ngữ cảnh tối đa cho mô hình. Khi các cuộc hội thoại đạt đến giới hạn này, Roo Code sẽ tự động cô đọng các tin nhắn cũ hơn để duy trì trong phạm vi ràng buộc.", + "rangeDescription": "Giá trị cao hơn cho phép các cuộc hội thoại dài hơn trước khi ngưng tụ, giá trị thấp hơn kích hoạt ngưng tụ sớm hơn để duy trì trong giới hạn tốc độ API." + }, "modelInfo": { "supportsImages": "Hỗ trợ hình ảnh", "noImages": "Không hỗ trợ hình ảnh", diff --git a/webview-ui/src/i18n/locales/zh-CN/settings.json b/webview-ui/src/i18n/locales/zh-CN/settings.json index 4f0a0e2e9cc..ec99c3251b8 100644 --- a/webview-ui/src/i18n/locales/zh-CN/settings.json +++ b/webview-ui/src/i18n/locales/zh-CN/settings.json @@ -497,6 +497,11 @@ "description": "控制模型响应的随机性", "rangeDescription": "值越高回答越多样,值越低越保守" }, + "maxContextWindow": { + "useCustom": "使用自定义最大上下文窗口", + "description": "设置模型的最大上下文窗口大小。当对话接近此限制时,Roo Code 会自动压缩较旧的消息以使其符合限制条件。", + "rangeDescription": "较高的值允许在压缩之前进行更长的对话,较低的值会更快地触发压缩以保持在 API 速率限制内。" + }, "modelInfo": { "supportsImages": "支持图像", "noImages": "不支持图像", diff --git a/webview-ui/src/i18n/locales/zh-TW/settings.json b/webview-ui/src/i18n/locales/zh-TW/settings.json index bf4b50049af..88035a7acbd 100644 --- a/webview-ui/src/i18n/locales/zh-TW/settings.json +++ b/webview-ui/src/i18n/locales/zh-TW/settings.json @@ -497,6 +497,11 @@ "description": "控制模型回應的隨機性", "rangeDescription": "較高值使輸出更隨機,較低值更確定" }, + "maxContextWindow": { + "useCustom": "使用自訂最大上下文視窗", + "description": "設定模型的最大上下文視窗大小。當對話接近此限制時,Roo Code 將自動壓縮舊訊息以保持在限制範圍內。.", + "rangeDescription": "較高的值允許在壓縮之前進行更長的對話,較低的值會更快觸發壓縮以保持在 API 速率限制內。" + }, "modelInfo": { "supportsImages": "支援影像", "noImages": "不支援影像", From dfad5851144e2d38254564dab94acfd162e835ed Mon Sep 17 00:00:00 2001 From: "Ton Hoang Nguyen (Bill)" <32552798+HahaBill@users.noreply.github.com> Date: Sat, 7 Jun 2025 22:51:50 +0100 Subject: [PATCH 06/20] feat: renamed the `modelMaxContextWindow` to `maxContextWindow` and added "maxContextWindow" to `settings.json` --- packages/types/src/provider-settings.ts | 4 ++-- src/api/providers/gemini.ts | 9 ++++++++- src/core/task/Task.ts | 4 ++-- webview-ui/src/components/settings/ApiOptions.tsx | 5 +++-- .../src/components/settings/ModelInfoView.tsx | 14 ++++++++++++++ webview-ui/src/i18n/locales/ca/settings.json | 1 + webview-ui/src/i18n/locales/de/settings.json | 1 + webview-ui/src/i18n/locales/en/settings.json | 1 + webview-ui/src/i18n/locales/es/settings.json | 7 +------ webview-ui/src/i18n/locales/fr/settings.json | 1 + webview-ui/src/i18n/locales/hi/settings.json | 1 + webview-ui/src/i18n/locales/it/settings.json | 1 + webview-ui/src/i18n/locales/ja/settings.json | 1 + webview-ui/src/i18n/locales/ko/settings.json | 1 + webview-ui/src/i18n/locales/nl/settings.json | 1 + webview-ui/src/i18n/locales/pl/settings.json | 1 + webview-ui/src/i18n/locales/pt-BR/settings.json | 1 + webview-ui/src/i18n/locales/ru/settings.json | 1 + webview-ui/src/i18n/locales/tr/settings.json | 1 + webview-ui/src/i18n/locales/vi/settings.json | 1 + webview-ui/src/i18n/locales/zh-CN/settings.json | 1 + webview-ui/src/i18n/locales/zh-TW/settings.json | 1 + 22 files changed, 46 insertions(+), 13 deletions(-) diff --git a/packages/types/src/provider-settings.ts b/packages/types/src/provider-settings.ts index d56bea8741c..3fab30df50e 100644 --- a/packages/types/src/provider-settings.ts +++ b/packages/types/src/provider-settings.ts @@ -152,7 +152,7 @@ const lmStudioSchema = baseProviderSettingsSchema.extend({ const geminiSchema = apiModelIdProviderModelSchema.extend({ geminiApiKey: z.string().optional(), googleGeminiBaseUrl: z.string().optional(), - modelMaxContextWindow: z.number().nullish(), + maxContextWindow: z.number().nullish(), }) const openAiNativeSchema = apiModelIdProviderModelSchema.extend({ @@ -319,7 +319,7 @@ export const PROVIDER_SETTINGS_KEYS = keysOf()([ // Gemini "geminiApiKey", "googleGeminiBaseUrl", - "modelMaxContextWindow", + "maxContextWindow", // OpenAI Native "openAiNativeApiKey", "openAiNativeBaseUrl", diff --git a/src/api/providers/gemini.ts b/src/api/providers/gemini.ts index 6765c8676d8..4150da11a30 100644 --- a/src/api/providers/gemini.ts +++ b/src/api/providers/gemini.ts @@ -132,9 +132,16 @@ export class GeminiHandler extends BaseProvider implements SingleCompletionHandl override getModel() { const modelId = this.options.apiModelId let id = modelId && modelId in geminiModels ? (modelId as GeminiModelId) : geminiDefaultModelId - const info: ModelInfo = geminiModels[id] + let info: ModelInfo = geminiModels[id] const params = getModelParams({ format: "gemini", modelId: id, model: info, settings: this.options }) + if (this.options.maxContextWindow) { + info = { + ...info, + contextWindow: this.options.maxContextWindow, + } + } + // The `:thinking` suffix indicates that the model is a "Hybrid" // reasoning model and that reasoning is required to be enabled. // The actual model ID honored by Gemini's API does not have this diff --git a/src/core/task/Task.ts b/src/core/task/Task.ts index 78f614fcaf3..b030dffbd33 100644 --- a/src/core/task/Task.ts +++ b/src/core/task/Task.ts @@ -1668,8 +1668,8 @@ export class Task extends EventEmitter { : modelInfo.maxTokens const contextWindow = - this.apiConfiguration.apiProvider === "gemini" && this.apiConfiguration.modelMaxContextWindow - ? this.apiConfiguration.modelMaxContextWindow + this.apiConfiguration.apiProvider === "gemini" && this.apiConfiguration.maxContextWindow + ? this.apiConfiguration.maxContextWindow : modelInfo.contextWindow const truncateResult = await truncateConversationIfNeeded({ diff --git a/webview-ui/src/components/settings/ApiOptions.tsx b/webview-ui/src/components/settings/ApiOptions.tsx index 85c4f496d32..8867e1cae5d 100644 --- a/webview-ui/src/components/settings/ApiOptions.tsx +++ b/webview-ui/src/components/settings/ApiOptions.tsx @@ -462,6 +462,7 @@ const ApiOptions = ({ modelInfo={selectedModelInfo} isDescriptionExpanded={isDescriptionExpanded} setIsDescriptionExpanded={setIsDescriptionExpanded} + maxContextWindow={selectedProvider === "gemini" ? apiConfiguration.maxContextWindow : undefined} /> )} @@ -488,8 +489,8 @@ const ApiOptions = ({ {selectedProvider === "gemini" && ( )} diff --git a/webview-ui/src/components/settings/ModelInfoView.tsx b/webview-ui/src/components/settings/ModelInfoView.tsx index 8078b03acd7..d38510f296f 100644 --- a/webview-ui/src/components/settings/ModelInfoView.tsx +++ b/webview-ui/src/components/settings/ModelInfoView.tsx @@ -14,6 +14,7 @@ type ModelInfoViewProps = { modelInfo?: ModelInfo isDescriptionExpanded: boolean setIsDescriptionExpanded: (isExpanded: boolean) => void + maxContextWindow?: number } export const ModelInfoView = ({ @@ -22,9 +23,13 @@ export const ModelInfoView = ({ modelInfo, isDescriptionExpanded, setIsDescriptionExpanded, + maxContextWindow, }: ModelInfoViewProps) => { const { t } = useAppTranslation() + const maxContextWindowValue = + apiProvider === "gemini" && maxContextWindow ? maxContextWindow : modelInfo?.contextWindow + const infoItems = [ ), + maxContextWindowValue && ( + <> + {t("settings:maxContextWindow.maxContextWindow")}:{" "} + {maxContextWindowValue.toLocaleString()} tokens + {apiProvider === "gemini" && maxContextWindowValue && ( + (custom limit) + )} + + ), apiProvider === "gemini" && ( {selectedModelId.includes("pro-preview") diff --git a/webview-ui/src/i18n/locales/ca/settings.json b/webview-ui/src/i18n/locales/ca/settings.json index 2ae26965474..d0d97ee3af8 100644 --- a/webview-ui/src/i18n/locales/ca/settings.json +++ b/webview-ui/src/i18n/locales/ca/settings.json @@ -504,6 +504,7 @@ "rangeDescription": "Valors més alts fan que la sortida sigui més aleatòria, valors més baixos la fan més determinista." }, "maxContextWindow": { + "maxContextWindow": "", "useCustom": "Utilitza una finestra de context màxim personalitzada", "description": "Estableix la mida màxima de la finestra de context per al model. Quan les converses s'acosten a aquest límit, Roo Code condensarà automàticament els missatges més antics per mantenir-se dins de la restricció.", "rangeDescription": "Els valors més alts permeten converses més llargues abans de condensar-se, els valors més baixos activen la condensació abans per mantenir-se dins dels límits de velocitat de l'API." diff --git a/webview-ui/src/i18n/locales/de/settings.json b/webview-ui/src/i18n/locales/de/settings.json index 0343ddb3adc..cfeab9f0ca2 100644 --- a/webview-ui/src/i18n/locales/de/settings.json +++ b/webview-ui/src/i18n/locales/de/settings.json @@ -504,6 +504,7 @@ "rangeDescription": "Höhere Werte machen die Ausgabe zufälliger, niedrigere Werte machen sie deterministischer." }, "maxContextWindow": { + "maxContextWindow": "Maximales Kontextfenster", "useCustom": "Benutzerdefiniertes maximales Kontextfenster verwenden", "description": "Legt die maximale Kontextfenstergröße für das Modell fest. Wenn Konversationen diese Grenze erreichen, komprimiert Roo Code ältere Nachrichten automatisch, um die Beschränkung einzuhalten.", "rangeDescription": "Höhere Werte ermöglichen längere Gespräche vor der Verdichtung, niedrigere Werte lösen eine frühere Verdichtung aus, um innerhalb der API-Ratengrenzen zu bleiben." diff --git a/webview-ui/src/i18n/locales/en/settings.json b/webview-ui/src/i18n/locales/en/settings.json index 8ee52536f4d..b5092550096 100644 --- a/webview-ui/src/i18n/locales/en/settings.json +++ b/webview-ui/src/i18n/locales/en/settings.json @@ -504,6 +504,7 @@ "rangeDescription": "Higher values make output more random, lower values make it more deterministic." }, "maxContextWindow": { + "maxContextWindow": "Max Context Window", "useCustom": "Use custom max context window", "description": "Sets the maximum context window size for the model. When conversations approach this limit, Roo Code will automatically condense older messages to stay within the constraint.", "rangeDescription": "Higher values allow longer conversations before condensing, lower values trigger condensing sooner to stay within API rate limits." diff --git a/webview-ui/src/i18n/locales/es/settings.json b/webview-ui/src/i18n/locales/es/settings.json index 1836f01095e..2bfbf762c69 100644 --- a/webview-ui/src/i18n/locales/es/settings.json +++ b/webview-ui/src/i18n/locales/es/settings.json @@ -44,12 +44,6 @@ "selectProviderPlaceholder": "Seleccionar proveedor", "openaiProvider": "OpenAI", "ollamaProvider": "Ollama", - "openaiCompatibleProvider": "Compatible con OpenAI", - "openaiCompatibleBaseUrlLabel": "URL base:", - "openaiCompatibleApiKeyLabel": "Clave API:", - "openaiCompatibleModelDimensionLabel": "Dimensión de Embedding:", - "openaiCompatibleModelDimensionPlaceholder": "ej., 1536", - "openaiCompatibleModelDimensionDescription": "La dimensión de embedding (tamaño de salida) para tu modelo. Consulta la documentación de tu proveedor para este valor. Valores comunes: 384, 768, 1536, 3072.", "openaiKeyLabel": "Clave de OpenAI:", "modelLabel": "Modelo", "selectModelPlaceholder": "Seleccionar modelo", @@ -504,6 +498,7 @@ "rangeDescription": "Valores más altos hacen que la salida sea más aleatoria, valores más bajos la hacen más determinista." }, "maxContextWindow": { + "maxContextWindow": "", "useCustom": "Usar ventana de contexto máxima personalizada", "description": "Establece el tamaño máximo de la ventana de contexto del modelo. Cuando las conversaciones se acercan a este límite, Roo Code condensará automáticamente los mensajes antiguos para ajustarse a la restricción.", "rangeDescription": "Los valores más altos permiten conversaciones más largas antes de condensarse; los valores más bajos activan la condensación antes para permanecer dentro de los límites de velocidad de la API." diff --git a/webview-ui/src/i18n/locales/fr/settings.json b/webview-ui/src/i18n/locales/fr/settings.json index 3b5d9be4958..057247594ce 100644 --- a/webview-ui/src/i18n/locales/fr/settings.json +++ b/webview-ui/src/i18n/locales/fr/settings.json @@ -504,6 +504,7 @@ "rangeDescription": "Des valeurs plus élevées rendent la sortie plus aléatoire, des valeurs plus basses la rendent plus déterministe." }, "maxContextWindow": { + "maxContextWindow": "", "useCustom": "Utiliser la fenêtre contextuelle maximale personnalisée", "description": "Définit la taille maximale de la fenêtre contextuelle du modèle. Lorsque les conversations approchent de cette limite, Roo Code condense automatiquement les messages plus anciens pour respecter la contrainte.", "rangeDescription": "Des valeurs plus élevées permettent des conversations plus longues avant la condensation, des valeurs plus faibles déclenchent la condensation plus tôt pour rester dans les limites de débit de l'API.." diff --git a/webview-ui/src/i18n/locales/hi/settings.json b/webview-ui/src/i18n/locales/hi/settings.json index 7b6a30d4f96..dedca0ac0a3 100644 --- a/webview-ui/src/i18n/locales/hi/settings.json +++ b/webview-ui/src/i18n/locales/hi/settings.json @@ -504,6 +504,7 @@ "rangeDescription": "उच्च मान आउटपुट को अधिक यादृच्छिक बनाते हैं, निम्न मान इसे अधिक निर्धारित बनाते हैं।" }, "maxContextWindow": { + "maxContextWindow": "", "useCustom": "कस्टम अधिकतम संदर्भ विंडो का उपयोग करें", "description": "मॉडल के लिए अधिकतम संदर्भ विंडो आकार सेट करता है। जब बातचीत इस सीमा के करीब पहुंचती है, तो रू कोड पुराने संदेशों को स्वचालित रूप से सीमा के भीतर रहने के लिए संक्षिप्त कर देगा।", "rangeDescription": "उच्चतर मान संघनन से पहले लम्बी बातचीत की अनुमति देते हैं, जबकि निम्न मान API दर सीमाओं के भीतर रहने के लिए शीघ्र ही संघनन को सक्रिय कर देते हैं।" diff --git a/webview-ui/src/i18n/locales/it/settings.json b/webview-ui/src/i18n/locales/it/settings.json index 655b7e0285e..244f250b1a3 100644 --- a/webview-ui/src/i18n/locales/it/settings.json +++ b/webview-ui/src/i18n/locales/it/settings.json @@ -504,6 +504,7 @@ "rangeDescription": "Valori più alti rendono l'output più casuale, valori più bassi lo rendono più deterministico." }, "maxContextWindow": { + "maxContextWindow": "Finestra di contesto massima", "useCustom": "Utilizza la finestra di contesto massima personalizzata", "description": "Imposta la dimensione massima della finestra di contesto per il modello. Quando le conversazioni si avvicinano a questo limite, Roo Code condensa automaticamente i messaggi più vecchi per rimanere entro il vincolo.", "rangeDescription": "Valori più alti consentono conversazioni più lunghe prima della condensazione, mentre valori più bassi attivano la condensazione prima per restare entro i limiti di velocità API." diff --git a/webview-ui/src/i18n/locales/ja/settings.json b/webview-ui/src/i18n/locales/ja/settings.json index 14b7a1bb577..39796b17aee 100644 --- a/webview-ui/src/i18n/locales/ja/settings.json +++ b/webview-ui/src/i18n/locales/ja/settings.json @@ -504,6 +504,7 @@ "rangeDescription": "高い値は出力をよりランダムに、低い値はより決定論的にします。" }, "maxContextWindow": { + "maxContextWindow": "最大コンテキストウィンドウ", "useCustom": "カスタム最大コンテキストウィンドウを使用する", "description": "モデルの最大コンテキストウィンドウサイズを設定します。会話がこの制限に近づくと、Roo Code は古いメッセージを自動的に圧縮して制限内に収めます。", "rangeDescription": "値が大きいほど、圧縮前の会話が長くなり、値が小さいほど、API レート制限内に収まるように圧縮が早くトリガーされます。" diff --git a/webview-ui/src/i18n/locales/ko/settings.json b/webview-ui/src/i18n/locales/ko/settings.json index 09f1b33a9ff..a86c012aa83 100644 --- a/webview-ui/src/i18n/locales/ko/settings.json +++ b/webview-ui/src/i18n/locales/ko/settings.json @@ -504,6 +504,7 @@ "rangeDescription": "높은 값은 출력을 더 무작위하게, 낮은 값은 더 결정적으로 만듭니다." }, "maxContextWindow": { + "maxContextWindow": "최대 컨텍스트 창", "useCustom": "사용자 정의 최대 컨텍스트 창 사용", "description": "모델의 최대 컨텍스트 창 크기를 설정합니다. 대화가 이 제한에 도달하면 Roo Code는 자동으로 이전 메시지를 압축하여 제한 범위 내에 있도록 합니다.", "rangeDescription": "값이 높을수록 응축되기 전에 더 긴 대화가 가능하고, 값이 낮을수록 API 속도 제한 내에 머물기 위해 더 빨리 응축이 실행됩니다." diff --git a/webview-ui/src/i18n/locales/nl/settings.json b/webview-ui/src/i18n/locales/nl/settings.json index a378a496100..c8c286b2a83 100644 --- a/webview-ui/src/i18n/locales/nl/settings.json +++ b/webview-ui/src/i18n/locales/nl/settings.json @@ -504,6 +504,7 @@ "rangeDescription": "Hogere waarden maken de output willekeuriger, lagere waarden maken deze deterministischer." }, "maxContextWindow": { + "maxContextWindow": "Maximaal contextvenster", "useCustom": "Gebruik aangepast maximaal contextvenster", "description": "Stelt de maximale grootte van het contextvenster voor het model in. Wanneer conversaties deze limiet naderen, condenseert Roo Code automatisch oudere berichten om binnen de beperking te blijven.", "rangeDescription": "Hogere waarden zorgen voor langere conversaties voordat er condensatie plaatsvindt, lagere waarden activeren eerder condensatie om binnen de API-snelheidslimieten te blijven." diff --git a/webview-ui/src/i18n/locales/pl/settings.json b/webview-ui/src/i18n/locales/pl/settings.json index 2d8c20c261b..114939e74f8 100644 --- a/webview-ui/src/i18n/locales/pl/settings.json +++ b/webview-ui/src/i18n/locales/pl/settings.json @@ -504,6 +504,7 @@ "rangeDescription": "Wyższe wartości sprawiają, że wyjście jest bardziej losowe, niższe wartości czynią je bardziej deterministycznym." }, "maxContextWindow": { + "maxContextWindow": "", "useCustom": "Użyj niestandardowego okna maksymalnego kontekstu", "description": "Ustawia maksymalny rozmiar okna kontekstu dla modelu. Gdy konwersacje zbliżają się do tego limitu, Roo Code automatycznie skondensuje starsze wiadomości, aby zachować ograniczenie.", "rangeDescription": "Wyższe wartości umożliwiają dłuższe konwersacje przed kondensacją, niższe wartości uruchamiają kondensację wcześniej, aby utrzymać się w granicach szybkości interfejsu API." diff --git a/webview-ui/src/i18n/locales/pt-BR/settings.json b/webview-ui/src/i18n/locales/pt-BR/settings.json index 65be27c4c3c..20ac0db20bc 100644 --- a/webview-ui/src/i18n/locales/pt-BR/settings.json +++ b/webview-ui/src/i18n/locales/pt-BR/settings.json @@ -504,6 +504,7 @@ "rangeDescription": "Valores mais altos tornam a saída mais aleatória, valores mais baixos a tornam mais determinística." }, "maxContextWindow": { + "maxContextWindow": "Janela de Contexto Máxima", "useCustom": "Usar janela de contexto máximo personalizada", "description": "Define o tamanho máximo da janela de contexto para o modelo. Quando as conversas se aproximam desse limite, o Roo Code condensa automaticamente as mensagens mais antigas para permanecer dentro da restrição.", "rangeDescription": "Valores mais altos permitem conversas mais longas antes da condensação, valores mais baixos acionam a condensação mais cedo para permanecer dentro dos limites de taxa da API." diff --git a/webview-ui/src/i18n/locales/ru/settings.json b/webview-ui/src/i18n/locales/ru/settings.json index dde8c42b120..e93040bf686 100644 --- a/webview-ui/src/i18n/locales/ru/settings.json +++ b/webview-ui/src/i18n/locales/ru/settings.json @@ -504,6 +504,7 @@ "rangeDescription": "Более высокие значения делают ответы более случайными, низкие — более детерминированными." }, "maxContextWindow": { + "maxContextWindow": "Максимальное окно контекста", "useCustom": "Использовать пользовательское максимальное контекстное окно", "description": "Устанавливает максимальный размер контекстного окна для модели. Когда разговоры приближаются к этому пределу, Roo Code автоматически сжимает старые сообщения, чтобы оставаться в рамках ограничения.", "rangeDescription": "Более высокие значения допускают более длительные разговоры перед сжатием, более низкие значения запускают сжатие раньше, чтобы оставаться в пределах ограничений скорости API." diff --git a/webview-ui/src/i18n/locales/tr/settings.json b/webview-ui/src/i18n/locales/tr/settings.json index 640e2171561..db1320a0155 100644 --- a/webview-ui/src/i18n/locales/tr/settings.json +++ b/webview-ui/src/i18n/locales/tr/settings.json @@ -504,6 +504,7 @@ "rangeDescription": "Daha yüksek değerler çıktıyı daha rastgele yapar, daha düşük değerler daha deterministik hale getirir." }, "maxContextWindow": { + "maxContextWindow": "Maksimum Bağlam Penceresi", "useCustom": "Özel maksimum bağlam penceresini kullan", "description": "Model için maksimum bağlam penceresi boyutunu ayarlar. Konuşmalar bu sınıra yaklaştığında, Roo Kodu kısıtlama dahilinde kalmak için eski mesajları otomatik olarak yoğunlaştıracaktır.", "rangeDescription": "Daha yüksek değerler, yoğunlaşmadan önce daha uzun görüşmelere izin verirken, daha düşük değerler API oran sınırları içinde kalmak için daha erken yoğunlaşmayı tetikler." diff --git a/webview-ui/src/i18n/locales/vi/settings.json b/webview-ui/src/i18n/locales/vi/settings.json index af94198a621..99e9c299dc2 100644 --- a/webview-ui/src/i18n/locales/vi/settings.json +++ b/webview-ui/src/i18n/locales/vi/settings.json @@ -504,6 +504,7 @@ "rangeDescription": "Giá trị cao hơn làm cho đầu ra ngẫu nhiên hơn, giá trị thấp hơn làm cho nó xác định hơn." }, "maxContextWindow": { + "maxContextWindow": "Cửa sổ ngữ cảnh tối đa", "useCustom": "Sử dụng cửa sổ ngữ cảnh tối đa tùy chỉnh", "description": "Đặt kích thước cửa sổ ngữ cảnh tối đa cho mô hình. Khi các cuộc hội thoại đạt đến giới hạn này, Roo Code sẽ tự động cô đọng các tin nhắn cũ hơn để duy trì trong phạm vi ràng buộc.", "rangeDescription": "Giá trị cao hơn cho phép các cuộc hội thoại dài hơn trước khi ngưng tụ, giá trị thấp hơn kích hoạt ngưng tụ sớm hơn để duy trì trong giới hạn tốc độ API." diff --git a/webview-ui/src/i18n/locales/zh-CN/settings.json b/webview-ui/src/i18n/locales/zh-CN/settings.json index 9c5b53ce5db..9c90f8a5c04 100644 --- a/webview-ui/src/i18n/locales/zh-CN/settings.json +++ b/webview-ui/src/i18n/locales/zh-CN/settings.json @@ -504,6 +504,7 @@ "rangeDescription": "值越高回答越多样,值越低越保守" }, "maxContextWindow": { + "maxContextWindow": "", "useCustom": "使用自定义最大上下文窗口", "description": "设置模型的最大上下文窗口大小。当对话接近此限制时,Roo Code 会自动压缩较旧的消息以使其符合限制条件。", "rangeDescription": "较高的值允许在压缩之前进行更长的对话,较低的值会更快地触发压缩以保持在 API 速率限制内。" diff --git a/webview-ui/src/i18n/locales/zh-TW/settings.json b/webview-ui/src/i18n/locales/zh-TW/settings.json index d6b7e7505f4..051ad388e1f 100644 --- a/webview-ui/src/i18n/locales/zh-TW/settings.json +++ b/webview-ui/src/i18n/locales/zh-TW/settings.json @@ -504,6 +504,7 @@ "rangeDescription": "較高值使輸出更隨機,較低值更確定" }, "maxContextWindow": { + "maxContextWindow": "最大上下文視窗", "useCustom": "使用自訂最大上下文視窗", "description": "設定模型的最大上下文視窗大小。當對話接近此限制時,Roo Code 將自動壓縮舊訊息以保持在限制範圍內。.", "rangeDescription": "較高的值允許在壓縮之前進行更長的對話,較低的值會更快觸發壓縮以保持在 API 速率限制內。" From 4a7a571ad16e448cab93cab615733fb13d6c5800 Mon Sep 17 00:00:00 2001 From: "Ton Hoang Nguyen (Bill)" <32552798+HahaBill@users.noreply.github.com> Date: Sat, 7 Jun 2025 23:30:02 +0100 Subject: [PATCH 07/20] feat: fix linting --- webview-ui/src/components/settings/ModelInfoView.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webview-ui/src/components/settings/ModelInfoView.tsx b/webview-ui/src/components/settings/ModelInfoView.tsx index d38510f296f..cccd5b62181 100644 --- a/webview-ui/src/components/settings/ModelInfoView.tsx +++ b/webview-ui/src/components/settings/ModelInfoView.tsx @@ -14,7 +14,7 @@ type ModelInfoViewProps = { modelInfo?: ModelInfo isDescriptionExpanded: boolean setIsDescriptionExpanded: (isExpanded: boolean) => void - maxContextWindow?: number + maxContextWindow?: number | null } export const ModelInfoView = ({ From d448d81478771e7c4a5da785d8a3476d01ba969b Mon Sep 17 00:00:00 2001 From: "Ton Hoang Nguyen (Bill)" <32552798+HahaBill@users.noreply.github.com> Date: Sun, 8 Jun 2025 00:46:51 +0100 Subject: [PATCH 08/20] fix: bringing back the openaiCompatible{__} - somehow Roo Code with Gemini 2.5 Pro deleted them during the task --- webview-ui/src/i18n/locales/es/settings.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/webview-ui/src/i18n/locales/es/settings.json b/webview-ui/src/i18n/locales/es/settings.json index 2bfbf762c69..6e1ebecf633 100644 --- a/webview-ui/src/i18n/locales/es/settings.json +++ b/webview-ui/src/i18n/locales/es/settings.json @@ -44,6 +44,12 @@ "selectProviderPlaceholder": "Seleccionar proveedor", "openaiProvider": "OpenAI", "ollamaProvider": "Ollama", + "openaiCompatibleProvider": "Compatible con OpenAI", + "openaiCompatibleBaseUrlLabel": "URL base:", + "openaiCompatibleApiKeyLabel": "Clave API:", + "openaiCompatibleModelDimensionLabel": "Dimensión de Embedding:", + "openaiCompatibleModelDimensionPlaceholder": "ej., 1536", + "openaiCompatibleModelDimensionDescription": "La dimensión de embedding (tamaño de salida) para tu modelo. Consulta la documentación de tu proveedor para este valor. Valores comunes: 384, 768, 1536, 3072.", "openaiKeyLabel": "Clave de OpenAI:", "modelLabel": "Modelo", "selectModelPlaceholder": "Seleccionar modelo", From 93ecb9ed675e6335d57633cc21b6be1c19fbf35a Mon Sep 17 00:00:00 2001 From: "Ton Hoang Nguyen (Bill)" <32552798+HahaBill@users.noreply.github.com> Date: Mon, 9 Jun 2025 10:12:23 +0100 Subject: [PATCH 09/20] test: Adding a unit test to test the `MaxContextWindowControl` component --- .../settings/MaxContextWindowControl.tsx | 2 +- .../MaxContextWindowControl.test.tsx | 57 +++++++++++++++++++ 2 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 webview-ui/src/components/settings/__tests__/MaxContextWindowControl.test.tsx diff --git a/webview-ui/src/components/settings/MaxContextWindowControl.tsx b/webview-ui/src/components/settings/MaxContextWindowControl.tsx index b4e9dd5793a..f0eaec56a26 100644 --- a/webview-ui/src/components/settings/MaxContextWindowControl.tsx +++ b/webview-ui/src/components/settings/MaxContextWindowControl.tsx @@ -52,7 +52,7 @@ export const MaxContextWindowControl = ({ value, onChange, maxValue = 1000000 }:
({ + ...jest.requireActual("@/components/ui"), + Slider: ({ value, onValueChange, min = 0, max = 100, "data-testid": dataTestId }: any) => ( + onValueChange([parseInt(e.target.value, 10)])} + data-testid={dataTestId} + /> + ), +})) + +describe("MaxContextWindowControl", () => { + it("updates when checkbox is toggled", async () => { + const onChange = jest.fn() + render() + + const checkbox = screen.getByRole("checkbox") as HTMLInputElement + fireEvent.click(checkbox) + + await new Promise((r) => setTimeout(r, 100)) + expect(onChange).toHaveBeenCalledWith(null) + + fireEvent.click(checkbox) + + await new Promise((r) => setTimeout(r, 100)) + expect(onChange).toHaveBeenCalledWith(123) + }) + + it("calls onChange when slider is moved", async () => { + const onChange = jest.fn() + render() + + const checkbox = screen.getByRole("checkbox") as HTMLInputElement + expect(checkbox).toBeChecked() + + const slider = screen.getByRole("slider") + fireEvent.change(slider, { target: { value: "50000" } }) + + await new Promise((r) => setTimeout(r, 120)) + + expect(onChange).toHaveBeenCalledWith(50000) + }) +}) From f63c1ac66c2dfce4a33ca7bc7d4f430ac0f9ca85 Mon Sep 17 00:00:00 2001 From: "Ton Hoang Nguyen (Bill)" <32552798+HahaBill@users.noreply.github.com> Date: Mon, 9 Jun 2025 11:54:57 +0100 Subject: [PATCH 10/20] test: adding a unit test in `Task.test.ts` to test whether `maxContextWindow` overtakes the model's Gemini context window value setting --- src/core/task/__tests__/Task.test.ts | 77 ++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) diff --git a/src/core/task/__tests__/Task.test.ts b/src/core/task/__tests__/Task.test.ts index 8ed57ffcb32..b8b12652ba2 100644 --- a/src/core/task/__tests__/Task.test.ts +++ b/src/core/task/__tests__/Task.test.ts @@ -14,6 +14,7 @@ import { ClineProvider } from "../../webview/ClineProvider" import { ApiStreamChunk } from "../../../api/transform/stream" import { ContextProxy } from "../../config/ContextProxy" import { processUserContentMentions } from "../../mentions/processUserContentMentions" +import * as slidingWindow from "../../sliding-window" jest.mock("execa", () => ({ execa: jest.fn(), @@ -533,6 +534,82 @@ describe("Cline", () => { }) }) + it("should use maxContextWindow when provider is gemini and maxContextWindow is set", async () => { + // Arrange: set apiProvider to gemini and maxContextWindow + const geminiConfig = { + ...mockApiConfig, + apiProvider: "gemini" as const, + maxContextWindow: 42, + } + const created = Task.create({ + provider: mockProvider, + apiConfiguration: geminiConfig, + task: "test gemini context window", + }) as unknown as [any, Promise] + const cline = created[0] as any + const task = created[1] as Promise + + // Stub model info to have a different default contextWindow + ;(cline.api as any).getModel = jest.fn().mockReturnValue({ + id: "gemini-model", + info: { + contextWindow: 100, + supportsReasoningBudget: true, + maxTokens: 1000, + supportsComputerUse: false, + supportsPromptCache: false, + inputPrice: 0, + outputPrice: 0, + }, + }) + + // Stub required methods to let attemptApiRequest proceed + ;(cline as any).getSystemPrompt = jest.fn().mockResolvedValue("") + ;(cline as any).getTokenUsage = jest.fn().mockReturnValue({ + contextTokens: 1, + totalTokensIn: 0, + totalTokensOut: 0, + totalCost: 0, + }) + + // Stub createMessage to avoid real API calls + jest.spyOn(cline.api as any, "createMessage").mockReturnValue((async function* () {})()) + + // Spy on truncateConversationIfNeeded to capture its options + const twSpy = jest.spyOn(slidingWindow, "truncateConversationIfNeeded").mockResolvedValue({ + messages: [], + summary: "", + cost: 0, + prevContextTokens: 0, + newContextTokens: 0, + error: undefined, + }) + + // Force abort immediately so the stream loop exits + Object.defineProperty(cline, "abort", { + get: () => true, + set: () => {}, + configurable: true, + }) + + // Act: run through the generator + try { + for await (const _ of cline.attemptApiRequest()) { + } + } catch { + /* ignore */ + } + + // Assert: the contextWindow passed to truncateConversationIfNeeded is the maxContextWindow + expect(twSpy).toHaveBeenCalled() + const optionsPassed = twSpy.mock.calls[0][0] + expect(optionsPassed.contextWindow).toBe(42) + + // Cleanup + await cline.abortTask(true) + await task.catch(() => {}) + }) + it.skip("should handle API retry with countdown", async () => { const [cline, task] = Task.create({ provider: mockProvider, From f5061703c72ba91388a3417d3fdf4be6095638c6 Mon Sep 17 00:00:00 2001 From: "Ton Hoang Nguyen (Bill)" <32552798+HahaBill@users.noreply.github.com> Date: Mon, 9 Jun 2025 12:19:20 +0100 Subject: [PATCH 11/20] test: change to `false` with `get: ()` in `maxContextWindow` test --- src/core/task/__tests__/Task.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/task/__tests__/Task.test.ts b/src/core/task/__tests__/Task.test.ts index b8b12652ba2..c7dce3dc8d9 100644 --- a/src/core/task/__tests__/Task.test.ts +++ b/src/core/task/__tests__/Task.test.ts @@ -587,7 +587,7 @@ describe("Cline", () => { // Force abort immediately so the stream loop exits Object.defineProperty(cline, "abort", { - get: () => true, + get: () => false, set: () => {}, configurable: true, }) From dbdfc6dffe1461107dbc0190b40d22e8c80cdb32 Mon Sep 17 00:00:00 2001 From: "Ton Hoang Nguyen (Bill)" <32552798+HahaBill@users.noreply.github.com> Date: Mon, 9 Jun 2025 14:37:23 +0100 Subject: [PATCH 12/20] fix: Update webview-ui/src/i18n/locales/zh-CN/settings.json Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> --- webview-ui/src/i18n/locales/zh-CN/settings.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webview-ui/src/i18n/locales/zh-CN/settings.json b/webview-ui/src/i18n/locales/zh-CN/settings.json index 9c90f8a5c04..124ae02c0d8 100644 --- a/webview-ui/src/i18n/locales/zh-CN/settings.json +++ b/webview-ui/src/i18n/locales/zh-CN/settings.json @@ -504,7 +504,7 @@ "rangeDescription": "值越高回答越多样,值越低越保守" }, "maxContextWindow": { - "maxContextWindow": "", + "maxContextWindow": "最大上下文窗口", "useCustom": "使用自定义最大上下文窗口", "description": "设置模型的最大上下文窗口大小。当对话接近此限制时,Roo Code 会自动压缩较旧的消息以使其符合限制条件。", "rangeDescription": "较高的值允许在压缩之前进行更长的对话,较低的值会更快地触发压缩以保持在 API 速率限制内。" From 504965370b1da3e52e08d79f36fdacab765d6d21 Mon Sep 17 00:00:00 2001 From: "Ton Hoang Nguyen (Bill)" <32552798+HahaBill@users.noreply.github.com> Date: Mon, 9 Jun 2025 14:37:36 +0100 Subject: [PATCH 13/20] fix: Update webview-ui/src/i18n/locales/zh-TW/settings.json Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> --- webview-ui/src/i18n/locales/zh-TW/settings.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webview-ui/src/i18n/locales/zh-TW/settings.json b/webview-ui/src/i18n/locales/zh-TW/settings.json index 051ad388e1f..5be2b914f04 100644 --- a/webview-ui/src/i18n/locales/zh-TW/settings.json +++ b/webview-ui/src/i18n/locales/zh-TW/settings.json @@ -506,7 +506,7 @@ "maxContextWindow": { "maxContextWindow": "最大上下文視窗", "useCustom": "使用自訂最大上下文視窗", - "description": "設定模型的最大上下文視窗大小。當對話接近此限制時,Roo Code 將自動壓縮舊訊息以保持在限制範圍內。.", + "description": "設定模型的最大上下文視窗大小。當對話接近此限制時,Roo Code 將自動壓縮舊訊息以保持在限制範圍內。", "rangeDescription": "較高的值允許在壓縮之前進行更長的對話,較低的值會更快觸發壓縮以保持在 API 速率限制內。" }, "modelInfo": { From 2badff71729f9db32fbacc236d5287caeea4f5e5 Mon Sep 17 00:00:00 2001 From: "Ton Hoang Nguyen (Bill)" <32552798+HahaBill@users.noreply.github.com> Date: Mon, 9 Jun 2025 14:37:46 +0100 Subject: [PATCH 14/20] fix: Update webview-ui/src/i18n/locales/fr/settings.json Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> --- webview-ui/src/i18n/locales/fr/settings.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webview-ui/src/i18n/locales/fr/settings.json b/webview-ui/src/i18n/locales/fr/settings.json index 057247594ce..aea6816df25 100644 --- a/webview-ui/src/i18n/locales/fr/settings.json +++ b/webview-ui/src/i18n/locales/fr/settings.json @@ -507,7 +507,7 @@ "maxContextWindow": "", "useCustom": "Utiliser la fenêtre contextuelle maximale personnalisée", "description": "Définit la taille maximale de la fenêtre contextuelle du modèle. Lorsque les conversations approchent de cette limite, Roo Code condense automatiquement les messages plus anciens pour respecter la contrainte.", - "rangeDescription": "Des valeurs plus élevées permettent des conversations plus longues avant la condensation, des valeurs plus faibles déclenchent la condensation plus tôt pour rester dans les limites de débit de l'API.." + "rangeDescription": "Des valeurs plus élevées permettent des conversations plus longues avant la condensation, des valeurs plus faibles déclenchent la condensation plus tôt pour rester dans les limites de débit de l'API." }, "modelInfo": { "supportsImages": "Prend en charge les images", From c0dd35959eb5427bf7d91ce25a680b9c4433e08c Mon Sep 17 00:00:00 2001 From: "Ton Hoang Nguyen (Bill)" <32552798+HahaBill@users.noreply.github.com> Date: Mon, 9 Jun 2025 14:38:23 +0100 Subject: [PATCH 15/20] fix: Update webview-ui/src/i18n/locales/ko/settings.json Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> --- webview-ui/src/i18n/locales/ko/settings.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webview-ui/src/i18n/locales/ko/settings.json b/webview-ui/src/i18n/locales/ko/settings.json index a86c012aa83..214c09f7663 100644 --- a/webview-ui/src/i18n/locales/ko/settings.json +++ b/webview-ui/src/i18n/locales/ko/settings.json @@ -506,7 +506,7 @@ "maxContextWindow": { "maxContextWindow": "최대 컨텍스트 창", "useCustom": "사용자 정의 최대 컨텍스트 창 사용", - "description": "모델의 최대 컨텍스트 창 크기를 설정합니다. 대화가 이 제한에 도달하면 Roo Code는 자동으로 이전 메시지를 압축하여 제한 범위 내에 있도록 합니다.", + "description": "모델의 최대 컨텍스트 창 크기를 설정합니다. 대화가 이 제한에 도달하면 Roo Code는 자동으로 이전 메시지를 응축하여 제한 범위 내에 있도록 합니다.", "rangeDescription": "값이 높을수록 응축되기 전에 더 긴 대화가 가능하고, 값이 낮을수록 API 속도 제한 내에 머물기 위해 더 빨리 응축이 실행됩니다." }, "modelInfo": { From 1cbd6f707a35509f01a0639a58e1556e07293cbb Mon Sep 17 00:00:00 2001 From: "Ton Hoang Nguyen (Bill)" <32552798+HahaBill@users.noreply.github.com> Date: Mon, 9 Jun 2025 14:38:38 +0100 Subject: [PATCH 16/20] fix: Update webview-ui/src/components/settings/MaxContextWindowControl.tsx Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> --- webview-ui/src/components/settings/MaxContextWindowControl.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webview-ui/src/components/settings/MaxContextWindowControl.tsx b/webview-ui/src/components/settings/MaxContextWindowControl.tsx index f0eaec56a26..075ab7e20ca 100644 --- a/webview-ui/src/components/settings/MaxContextWindowControl.tsx +++ b/webview-ui/src/components/settings/MaxContextWindowControl.tsx @@ -35,7 +35,7 @@ export const MaxContextWindowControl = ({ value, onChange, maxValue = 1000000 }: setIsCustomMaxContextWindow(isChecked) if (!isChecked) { - setInputValue(null) // Unset the temperature, note that undefined is unserializable. + setInputValue(null) // Unset the max context window, note that undefined is unserializable. } else { setInputValue(value ?? 0) // Use the value from apiConfiguration, if set. } From 16ffd7197d9d50c2d0d0c676e6ca1d643ed68d70 Mon Sep 17 00:00:00 2001 From: "Ton Hoang Nguyen (Bill)" <32552798+HahaBill@users.noreply.github.com> Date: Mon, 9 Jun 2025 14:38:49 +0100 Subject: [PATCH 17/20] fix: Update webview-ui/src/i18n/locales/pt-BR/settings.json Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> --- webview-ui/src/i18n/locales/pt-BR/settings.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webview-ui/src/i18n/locales/pt-BR/settings.json b/webview-ui/src/i18n/locales/pt-BR/settings.json index 20ac0db20bc..07262e153ba 100644 --- a/webview-ui/src/i18n/locales/pt-BR/settings.json +++ b/webview-ui/src/i18n/locales/pt-BR/settings.json @@ -505,7 +505,7 @@ }, "maxContextWindow": { "maxContextWindow": "Janela de Contexto Máxima", - "useCustom": "Usar janela de contexto máximo personalizada", + "useCustom": "Usar janela de contexto máxima personalizada", "description": "Define o tamanho máximo da janela de contexto para o modelo. Quando as conversas se aproximam desse limite, o Roo Code condensa automaticamente as mensagens mais antigas para permanecer dentro da restrição.", "rangeDescription": "Valores mais altos permitem conversas mais longas antes da condensação, valores mais baixos acionam a condensação mais cedo para permanecer dentro dos limites de taxa da API." }, From 38a9a583d4a2ef44bb91f43db0feaaad87b676b5 Mon Sep 17 00:00:00 2001 From: "Ton Hoang Nguyen (Bill)" <32552798+HahaBill@users.noreply.github.com> Date: Mon, 9 Jun 2025 14:39:58 +0100 Subject: [PATCH 18/20] fix: change from `hasCustomTemperature` to `hasCustomMaxContextWindow` for comprehension --- .../src/components/settings/MaxContextWindowControl.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webview-ui/src/components/settings/MaxContextWindowControl.tsx b/webview-ui/src/components/settings/MaxContextWindowControl.tsx index f0eaec56a26..903c34606db 100644 --- a/webview-ui/src/components/settings/MaxContextWindowControl.tsx +++ b/webview-ui/src/components/settings/MaxContextWindowControl.tsx @@ -20,8 +20,8 @@ export const MaxContextWindowControl = ({ value, onChange, maxValue = 1000000 }: // Sync internal state with prop changes when switching profiles. useEffect(() => { - const hasCustomTemperature = value !== undefined && value !== null - setIsCustomMaxContextWindow(hasCustomTemperature) + const hasCustomMaxContextWindow = value !== undefined && value !== null + setIsCustomMaxContextWindow(hasCustomMaxContextWindow) setInputValue(value) }, [value]) From b411e08632da48b1551f28270878b140ed6799e3 Mon Sep 17 00:00:00 2001 From: "Ton Hoang Nguyen (Bill)" <32552798+HahaBill@users.noreply.github.com> Date: Mon, 9 Jun 2025 14:57:09 +0100 Subject: [PATCH 19/20] fix: experimental commit due to GitHub Action errors --- webview-ui/src/components/settings/MaxContextWindowControl.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webview-ui/src/components/settings/MaxContextWindowControl.tsx b/webview-ui/src/components/settings/MaxContextWindowControl.tsx index 58f3b9a9714..b6998ef4e26 100644 --- a/webview-ui/src/components/settings/MaxContextWindowControl.tsx +++ b/webview-ui/src/components/settings/MaxContextWindowControl.tsx @@ -35,7 +35,7 @@ export const MaxContextWindowControl = ({ value, onChange, maxValue = 1000000 }: setIsCustomMaxContextWindow(isChecked) if (!isChecked) { - setInputValue(null) // Unset the max context window, note that undefined is unserializable. + setInputValue(null) // Unset the max context window limit, note that undefined is unserializable. } else { setInputValue(value ?? 0) // Use the value from apiConfiguration, if set. } From 4e72a0607ec513d49eb3d6db8835ff5c377774cc Mon Sep 17 00:00:00 2001 From: "Ton Hoang Nguyen (Bill)" <32552798+HahaBill@users.noreply.github.com> Date: Mon, 9 Jun 2025 15:33:48 +0100 Subject: [PATCH 20/20] Revert "fix: Update webview-ui/src/i18n/locales/pt-BR/settings.json" This reverts commit 16ffd7197d9d50c2d0d0c676e6ca1d643ed68d70. --- webview-ui/src/i18n/locales/pt-BR/settings.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webview-ui/src/i18n/locales/pt-BR/settings.json b/webview-ui/src/i18n/locales/pt-BR/settings.json index 07262e153ba..20ac0db20bc 100644 --- a/webview-ui/src/i18n/locales/pt-BR/settings.json +++ b/webview-ui/src/i18n/locales/pt-BR/settings.json @@ -505,7 +505,7 @@ }, "maxContextWindow": { "maxContextWindow": "Janela de Contexto Máxima", - "useCustom": "Usar janela de contexto máxima personalizada", + "useCustom": "Usar janela de contexto máximo personalizada", "description": "Define o tamanho máximo da janela de contexto para o modelo. Quando as conversas se aproximam desse limite, o Roo Code condensa automaticamente as mensagens mais antigas para permanecer dentro da restrição.", "rangeDescription": "Valores mais altos permitem conversas mais longas antes da condensação, valores mais baixos acionam a condensação mais cedo para permanecer dentro dos limites de taxa da API." },