From e5be1f87d2546747dc9d03f8ea81280bde61bfde Mon Sep 17 00:00:00 2001 From: Chris Hasson Date: Thu, 15 May 2025 08:26:10 -0700 Subject: [PATCH 1/6] feat(settings): Introduce the "auto-approve request count" feature from Cline MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is the first minor UI feature I've added, so please let me know if I'm missing anything! (translations, organization, etc!) Please see commits for details introduce allowedMaxRequests to globalSettingsSchema update ExtensionState and its context with allowedMaxRequests implement UI for setting max requests in AutoApproveMenu component prompt user when auto-approval limit is reached with i18n support increment consecutiveAutoApprovedRequestsCount and reset upon user approval add translations for auto-approved request limit reached prompt in multiple languages add new UI for "auto_approval_max_req_reached" in ChatRowContent display prompt with title, description, and button for user action 🔧 chore(gitignore): add .idea to .gitignore to exclude IDE-specific files - remove .idea/workspace.xml to clean up repository --- .changeset/fruity-spoons-smash.md | 5 +++ evals/packages/types/src/roo-code.ts | 1 + src/core/task/Task.ts | 24 +++++++++++ src/core/webview/ClineProvider.ts | 4 +- src/core/webview/webviewMessageHandler.ts | 4 ++ src/exports/roo-code.d.ts | 7 +++ src/exports/types.ts | 7 +++ src/i18n/locales/ca/common.json | 7 +++ src/i18n/locales/de/common.json | 7 +++ src/i18n/locales/en/common.json | 7 +++ src/i18n/locales/es/common.json | 7 +++ src/i18n/locales/fr/common.json | 7 +++ src/i18n/locales/hi/common.json | 7 +++ src/i18n/locales/it/common.json | 7 +++ src/i18n/locales/ja/common.json | 7 +++ src/i18n/locales/ko/common.json | 7 +++ src/i18n/locales/nl/common.json | 7 +++ src/i18n/locales/pl/common.json | 7 +++ src/i18n/locales/pt-BR/common.json | 7 +++ src/i18n/locales/ru/common.json | 7 +++ src/i18n/locales/tr/common.json | 7 +++ src/i18n/locales/vi/common.json | 7 +++ src/i18n/locales/zh-CN/common.json | 7 +++ src/i18n/locales/zh-TW/common.json | 7 +++ src/schemas/index.ts | 3 ++ src/shared/ExtensionMessage.ts | 1 + src/shared/WebviewMessage.ts | 1 + .../src/components/chat/AutoApproveMenu.tsx | 43 ++++++++++++++++++- .../chat/AutoApprovedRequestLimitWarning.tsx | 40 +++++++++++++++++ webview-ui/src/components/chat/ChatRow.tsx | 4 ++ .../src/components/settings/SettingsView.tsx | 2 + .../src/context/ExtensionStateContext.tsx | 3 ++ webview-ui/src/i18n/locales/ca/settings.json | 3 ++ webview-ui/src/i18n/locales/de/settings.json | 3 ++ webview-ui/src/i18n/locales/en/settings.json | 3 ++ webview-ui/src/i18n/locales/es/settings.json | 3 ++ webview-ui/src/i18n/locales/fr/settings.json | 3 ++ webview-ui/src/i18n/locales/hi/settings.json | 3 ++ webview-ui/src/i18n/locales/it/settings.json | 3 ++ webview-ui/src/i18n/locales/ja/settings.json | 3 ++ webview-ui/src/i18n/locales/ko/settings.json | 3 ++ webview-ui/src/i18n/locales/nl/settings.json | 3 ++ webview-ui/src/i18n/locales/pl/settings.json | 3 ++ .../src/i18n/locales/pt-BR/settings.json | 3 ++ webview-ui/src/i18n/locales/ru/settings.json | 3 ++ webview-ui/src/i18n/locales/tr/settings.json | 3 ++ webview-ui/src/i18n/locales/vi/settings.json | 3 ++ .../src/i18n/locales/zh-CN/settings.json | 3 ++ .../src/i18n/locales/zh-TW/settings.json | 3 ++ 49 files changed, 317 insertions(+), 2 deletions(-) create mode 100644 .changeset/fruity-spoons-smash.md create mode 100644 webview-ui/src/components/chat/AutoApprovedRequestLimitWarning.tsx diff --git a/.changeset/fruity-spoons-smash.md b/.changeset/fruity-spoons-smash.md new file mode 100644 index 00000000000..10546c5bd1d --- /dev/null +++ b/.changeset/fruity-spoons-smash.md @@ -0,0 +1,5 @@ +--- +"roo-cline": minor +--- + +Added an auto-approve API request limit setting similar to Cline diff --git a/evals/packages/types/src/roo-code.ts b/evals/packages/types/src/roo-code.ts index a33874129bc..338ecd8b2a5 100644 --- a/evals/packages/types/src/roo-code.ts +++ b/evals/packages/types/src/roo-code.ts @@ -961,6 +961,7 @@ export const clineAsks = [ "resume_task", "resume_completed_task", "mistake_limit_reached", + "auto_approval_max_req_reached", "browser_action_launch", "use_mcp_server", ] as const diff --git a/src/core/task/Task.ts b/src/core/task/Task.ts index b301904f7ac..47565b0200b 100644 --- a/src/core/task/Task.ts +++ b/src/core/task/Task.ts @@ -78,6 +78,7 @@ import { processUserContentMentions } from "../mentions/processUserContentMentio import { ApiMessage } from "../task-persistence/apiMessages" import { getMessagesSinceLastSummary } from "../condense" import { maybeRemoveImageBlocks } from "../../api/transform/image-cleaning" +import { t } from "../../i18n" export type ClineEvents = { message: [{ action: "created" | "updated"; message: ClineMessage }] @@ -134,6 +135,7 @@ export class Task extends EventEmitter { readonly apiConfiguration: ProviderSettings api: ApiHandler private lastApiRequestTime?: number + private consecutiveAutoApprovedRequestsCount: number = 0 toolRepetitionDetector: ToolRepetitionDetector rooIgnoreController?: RooIgnoreController @@ -1505,6 +1507,28 @@ export class Task extends EventEmitter { ({ role, content }) => ({ role, content }), ) + // Check if we've reached the maximum number of auto-approved requests + const { allowedMaxRequests } = (await this.providerRef.deref()?.getState()) ?? {} + const maxRequests = allowedMaxRequests || Infinity + + // Increment the counter for each new API request + this.consecutiveAutoApprovedRequestsCount++ + + if (this.consecutiveAutoApprovedRequestsCount > maxRequests) { + const { response } = await this.ask( + "auto_approval_max_req_reached", + JSON.stringify({ + title: t("common:ask.autoApprovedRequestLimitReached.title"), + description: t("common:ask.autoApprovedRequestLimitReached.description", { count: maxRequests }), + button: t("common:ask.autoApprovedRequestLimitReached.button"), + }), + ) + // If we get past the promise, it means the user approved and did not start a new task + if (response === "yesButtonClicked") { + this.consecutiveAutoApprovedRequestsCount = 0 + } + } + const stream = this.api.createMessage(systemPrompt, cleanConversationHistory) const iterator = stream[Symbol.asyncIterator]() diff --git a/src/core/webview/ClineProvider.ts b/src/core/webview/ClineProvider.ts index 67ab693f66c..7e22dbbbccf 100644 --- a/src/core/webview/ClineProvider.ts +++ b/src/core/webview/ClineProvider.ts @@ -1193,6 +1193,7 @@ export class ClineProvider extends EventEmitter implements alwaysAllowMcp, alwaysAllowModeSwitch, alwaysAllowSubtasks, + allowedMaxRequests, soundEnabled, ttsEnabled, ttsSpeed, @@ -1263,6 +1264,7 @@ export class ClineProvider extends EventEmitter implements alwaysAllowMcp: alwaysAllowMcp ?? false, alwaysAllowModeSwitch: alwaysAllowModeSwitch ?? false, alwaysAllowSubtasks: alwaysAllowSubtasks ?? false, + allowedMaxRequests: allowedMaxRequests ?? Infinity, uriScheme: vscode.env.uriScheme, currentTaskItem: this.getCurrentCline()?.taskId ? (taskHistory || []).find((item: HistoryItem) => item.id === this.getCurrentCline()?.taskId) @@ -1337,7 +1339,6 @@ export class ClineProvider extends EventEmitter implements async getState() { const stateValues = this.contextProxy.getValues() - const customModes = await this.customModesManager.getCustomModes() // Determine apiProvider with the same logic as before. @@ -1366,6 +1367,7 @@ export class ClineProvider extends EventEmitter implements alwaysAllowMcp: stateValues.alwaysAllowMcp ?? false, alwaysAllowModeSwitch: stateValues.alwaysAllowModeSwitch ?? false, alwaysAllowSubtasks: stateValues.alwaysAllowSubtasks ?? false, + allowedMaxRequests: stateValues.allowedMaxRequests ?? Infinity, taskHistory: stateValues.taskHistory, allowedCommands: stateValues.allowedCommands, soundEnabled: stateValues.soundEnabled ?? false, diff --git a/src/core/webview/webviewMessageHandler.ts b/src/core/webview/webviewMessageHandler.ts index e26e08fdcc9..d91d3d57730 100644 --- a/src/core/webview/webviewMessageHandler.ts +++ b/src/core/webview/webviewMessageHandler.ts @@ -160,6 +160,10 @@ export const webviewMessageHandler = async (provider: ClineProvider, message: We await updateGlobalState("alwaysAllowModeSwitch", message.bool) await provider.postStateToWebview() break + case "allowedMaxRequests": + await updateGlobalState("allowedMaxRequests", message.value) + await provider.postStateToWebview() + break case "alwaysAllowSubtasks": await updateGlobalState("alwaysAllowSubtasks", message.bool) await provider.postStateToWebview() diff --git a/src/exports/roo-code.d.ts b/src/exports/roo-code.d.ts index 53d9673b730..f68889f5308 100644 --- a/src/exports/roo-code.d.ts +++ b/src/exports/roo-code.d.ts @@ -70,6 +70,7 @@ type GlobalSettings = { alwaysAllowSubtasks?: boolean | undefined alwaysAllowExecute?: boolean | undefined allowedCommands?: string[] | undefined + allowedMaxRequests?: number | undefined browserToolEnabled?: boolean | undefined browserViewportSize?: string | undefined screenshotQuality?: number | undefined @@ -380,6 +381,7 @@ type ClineMessage = { | "mistake_limit_reached" | "browser_action_launch" | "use_mcp_server" + | "auto_approval_max_req_reached" ) | undefined say?: @@ -464,6 +466,7 @@ type RooCodeEvents = { | "mistake_limit_reached" | "browser_action_launch" | "use_mcp_server" + | "auto_approval_max_req_reached" ) | undefined say?: @@ -801,6 +804,7 @@ type IpcMessage = alwaysAllowSubtasks?: boolean | undefined alwaysAllowExecute?: boolean | undefined allowedCommands?: string[] | undefined + allowedMaxRequests?: number | undefined browserToolEnabled?: boolean | undefined browserViewportSize?: string | undefined screenshotQuality?: number | undefined @@ -942,6 +946,7 @@ type IpcMessage = | "mistake_limit_reached" | "browser_action_launch" | "use_mcp_server" + | "auto_approval_max_req_reached" ) | undefined say?: @@ -1273,6 +1278,7 @@ type TaskCommand = alwaysAllowSubtasks?: boolean | undefined alwaysAllowExecute?: boolean | undefined allowedCommands?: string[] | undefined + allowedMaxRequests?: number | undefined browserToolEnabled?: boolean | undefined browserViewportSize?: string | undefined screenshotQuality?: number | undefined @@ -1410,6 +1416,7 @@ type TaskEvent = | "mistake_limit_reached" | "browser_action_launch" | "use_mcp_server" + | "auto_approval_max_req_reached" ) | undefined say?: diff --git a/src/exports/types.ts b/src/exports/types.ts index 2bc487c2f93..752ea976c13 100644 --- a/src/exports/types.ts +++ b/src/exports/types.ts @@ -70,6 +70,7 @@ type GlobalSettings = { alwaysAllowSubtasks?: boolean | undefined alwaysAllowExecute?: boolean | undefined allowedCommands?: string[] | undefined + allowedMaxRequests?: number | undefined browserToolEnabled?: boolean | undefined browserViewportSize?: string | undefined screenshotQuality?: number | undefined @@ -388,6 +389,7 @@ type ClineMessage = { | "mistake_limit_reached" | "browser_action_launch" | "use_mcp_server" + | "auto_approval_max_req_reached" ) | undefined say?: @@ -476,6 +478,7 @@ type RooCodeEvents = { | "mistake_limit_reached" | "browser_action_launch" | "use_mcp_server" + | "auto_approval_max_req_reached" ) | undefined say?: @@ -815,6 +818,7 @@ type IpcMessage = alwaysAllowSubtasks?: boolean | undefined alwaysAllowExecute?: boolean | undefined allowedCommands?: string[] | undefined + allowedMaxRequests?: number | undefined browserToolEnabled?: boolean | undefined browserViewportSize?: string | undefined screenshotQuality?: number | undefined @@ -956,6 +960,7 @@ type IpcMessage = | "mistake_limit_reached" | "browser_action_launch" | "use_mcp_server" + | "auto_approval_max_req_reached" ) | undefined say?: @@ -1289,6 +1294,7 @@ type TaskCommand = alwaysAllowSubtasks?: boolean | undefined alwaysAllowExecute?: boolean | undefined allowedCommands?: string[] | undefined + allowedMaxRequests?: number | undefined browserToolEnabled?: boolean | undefined browserViewportSize?: string | undefined screenshotQuality?: number | undefined @@ -1428,6 +1434,7 @@ type TaskEvent = | "mistake_limit_reached" | "browser_action_launch" | "use_mcp_server" + | "auto_approval_max_req_reached" ) | undefined say?: diff --git a/src/i18n/locales/ca/common.json b/src/i18n/locales/ca/common.json index c9994fdeaad..1ee81cfe053 100644 --- a/src/i18n/locales/ca/common.json +++ b/src/i18n/locales/ca/common.json @@ -96,5 +96,12 @@ "groqApiKey": "Clau API de Groq", "getGroqApiKey": "Obté la clau API de Groq" } + }, + "ask": { + "autoApprovedRequestLimitReached": { + "title": "Límit de Sol·licituds Aprovades Automàticament Assolit", + "description": "Roo ha assolit el límit de {{count}} sol·licituds d'API aprovades automàticament. Vols restablir el comptador i continuar amb la tasca?", + "button": "Restablir i Continuar" + } } } diff --git a/src/i18n/locales/de/common.json b/src/i18n/locales/de/common.json index 982dc96da90..f40c455a892 100644 --- a/src/i18n/locales/de/common.json +++ b/src/i18n/locales/de/common.json @@ -96,5 +96,12 @@ "groqApiKey": "Groq API-Schlüssel", "getGroqApiKey": "Groq API-Schlüssel erhalten" } + }, + "ask": { + "autoApprovedRequestLimitReached": { + "title": "Limit für automatisch genehmigte Anfragen erreicht", + "description": "Roo hat das Limit von {{count}} automatisch genehmigten API-Anfragen erreicht. Möchten Sie den Zähler zurücksetzen und mit der Aufgabe fortfahren?", + "button": "Zurücksetzen und Fortfahren" + } } } diff --git a/src/i18n/locales/en/common.json b/src/i18n/locales/en/common.json index 06b371624b6..9b5dd7e5c98 100644 --- a/src/i18n/locales/en/common.json +++ b/src/i18n/locales/en/common.json @@ -90,5 +90,12 @@ "input": { "task_prompt": "What should Roo do?", "task_placeholder": "Type your task here" + }, + "ask": { + "autoApprovedRequestLimitReached": { + "title": "Auto-Approved Request Limit Reached", + "description": "Roo has reached the auto-approved limit of {{count}} API requests. Would you like to reset the count and proceed with the task?", + "button": "Reset and Continue" + } } } diff --git a/src/i18n/locales/es/common.json b/src/i18n/locales/es/common.json index ce4acbc7447..ff3788678af 100644 --- a/src/i18n/locales/es/common.json +++ b/src/i18n/locales/es/common.json @@ -96,5 +96,12 @@ "groqApiKey": "Clave API de Groq", "getGroqApiKey": "Obtener clave API de Groq" } + }, + "ask": { + "autoApprovedRequestLimitReached": { + "title": "Límite de Solicitudes Aprobadas Automáticamente Alcanzado", + "description": "Roo ha alcanzado el límite de {{count}} solicitudes de API aprobadas automáticamente. ¿Te gustaría restablecer el contador y continuar con la tarea?", + "button": "Restablecer y Continuar" + } } } diff --git a/src/i18n/locales/fr/common.json b/src/i18n/locales/fr/common.json index 262ef2659ff..1679bee5072 100644 --- a/src/i18n/locales/fr/common.json +++ b/src/i18n/locales/fr/common.json @@ -96,5 +96,12 @@ "groqApiKey": "Clé API Groq", "getGroqApiKey": "Obtenir la clé API Groq" } + }, + "ask": { + "autoApprovedRequestLimitReached": { + "title": "Limite de Demandes Approuvées Automatiquement Atteinte", + "description": "Roo a atteint la limite de {{count}} demandes d'API approuvées automatiquement. Souhaitez-vous réinitialiser le compteur et poursuivre la tâche ?", + "button": "Réinitialiser et Continuer" + } } } diff --git a/src/i18n/locales/hi/common.json b/src/i18n/locales/hi/common.json index 9959b85f6e6..587c9f957b1 100644 --- a/src/i18n/locales/hi/common.json +++ b/src/i18n/locales/hi/common.json @@ -96,5 +96,12 @@ "groqApiKey": "ग्रोक एपीआई कुंजी", "getGroqApiKey": "ग्रोक एपीआई कुंजी प्राप्त करें" } + }, + "ask": { + "autoApprovedRequestLimitReached": { + "title": "स्वतः-अनुमोदित अनुरोध सीमा समाप्त", + "description": "Roo {{count}} स्वतः-अनुमोदित एपीआई अनुरोधों की सीमा तक पहुंच गया है। क्या आप गिनती रीसेट करना और कार्य के साथ आगे बढ़ना चाहेंगे?", + "button": "रीसेट करें और जारी रखें" + } } } diff --git a/src/i18n/locales/it/common.json b/src/i18n/locales/it/common.json index f3f9a0ce196..7b0d0865f49 100644 --- a/src/i18n/locales/it/common.json +++ b/src/i18n/locales/it/common.json @@ -96,5 +96,12 @@ "groqApiKey": "Chiave API Groq", "getGroqApiKey": "Ottieni chiave API Groq" } + }, + "ask": { + "autoApprovedRequestLimitReached": { + "title": "Limite Richieste Approvate Automaticamente Raggiunto", + "description": "Roo ha raggiunto il limite di {{count}} richieste API approvate automaticamente. Vuoi reimpostare il conteggio e procedere con l'attività?", + "button": "Reimposta e Continua" + } } } diff --git a/src/i18n/locales/ja/common.json b/src/i18n/locales/ja/common.json index fd1860a1de7..196bcbc266d 100644 --- a/src/i18n/locales/ja/common.json +++ b/src/i18n/locales/ja/common.json @@ -96,5 +96,12 @@ "groqApiKey": "Groq APIキー", "getGroqApiKey": "Groq APIキーを取得" } + }, + "ask": { + "autoApprovedRequestLimitReached": { + "title": "自動承認リクエスト上限に到達しました", + "description": "Rooは自動承認されたAPIリクエストの上限{{count}}件に達しました。カウントをリセットしてタスクを続行しますか?", + "button": "リセットして続行" + } } } diff --git a/src/i18n/locales/ko/common.json b/src/i18n/locales/ko/common.json index 4bea1be3b4f..01157efeb1a 100644 --- a/src/i18n/locales/ko/common.json +++ b/src/i18n/locales/ko/common.json @@ -96,5 +96,12 @@ "groqApiKey": "Groq API 키", "getGroqApiKey": "Groq API 키 받기" } + }, + "ask": { + "autoApprovedRequestLimitReached": { + "title": "자동 승인된 요청 한도 도달", + "description": "Roo가 자동 승인된 API 요청 한도인 {{count}}개에 도달했습니다. 횟수를 재설정하고 작업을 계속하시겠습니까?", + "button": "재설정하고 계속하기" + } } } diff --git a/src/i18n/locales/nl/common.json b/src/i18n/locales/nl/common.json index a758d149fa3..b5c4a291705 100644 --- a/src/i18n/locales/nl/common.json +++ b/src/i18n/locales/nl/common.json @@ -90,5 +90,12 @@ "input": { "task_prompt": "Wat moet Roo doen?", "task_placeholder": "Typ hier je taak" + }, + "ask": { + "autoApprovedRequestLimitReached": { + "button": "Reset en Doorgaan", + "description": "Roo heeft de automatisch goedgekeurde limiet van {{count}} API-aanvragen bereikt. Wilt u het aantal resetten en doorgaan met de taak?", + "title": "Limiet voor Automatisch Goedgekeurde Aanvragen Bereikt" + } } } diff --git a/src/i18n/locales/pl/common.json b/src/i18n/locales/pl/common.json index 1c4152f02d2..179036127bd 100644 --- a/src/i18n/locales/pl/common.json +++ b/src/i18n/locales/pl/common.json @@ -96,5 +96,12 @@ "groqApiKey": "Klucz API Groq", "getGroqApiKey": "Uzyskaj klucz API Groq" } + }, + "ask": { + "autoApprovedRequestLimitReached": { + "title": "Osiągnięto Limit Automatycznie Zatwierdzonych Żądań", + "description": "Roo osiągnął limit {{count}} automatycznie zatwierdzonych żądań API. Czy chcesz zresetować licznik i kontynuować zadanie?", + "button": "Zresetuj i Kontynuuj" + } } } diff --git a/src/i18n/locales/pt-BR/common.json b/src/i18n/locales/pt-BR/common.json index d80d5eaf12d..d3bdf74a33b 100644 --- a/src/i18n/locales/pt-BR/common.json +++ b/src/i18n/locales/pt-BR/common.json @@ -96,5 +96,12 @@ "groqApiKey": "Chave de API Groq", "getGroqApiKey": "Obter chave de API Groq" } + }, + "ask": { + "autoApprovedRequestLimitReached": { + "title": "Limite de Solicitações Aprovadas Automaticamente Atingido", + "description": "O Roo atingiu o limite de {{count}} solicitações de API aprovadas automaticamente. Gostaria de zerar a contagem e prosseguir com a tarefa?", + "button": "Zerar e Continuar" + } } } diff --git a/src/i18n/locales/ru/common.json b/src/i18n/locales/ru/common.json index c4c1b01de5f..c46ca41a963 100644 --- a/src/i18n/locales/ru/common.json +++ b/src/i18n/locales/ru/common.json @@ -96,5 +96,12 @@ "groqApiKey": "Ключ API Groq", "getGroqApiKey": "Получить ключ API Groq" } + }, + "ask": { + "autoApprovedRequestLimitReached": { + "button": "Сбросить и продолжить", + "title": "Достигнут лимит автоматически одобренных запросов", + "description": "Roo достиг автоматически одобренного лимита в {{count}} API запросов. Хотите сбросить счетчик и продолжить задачу?" + } } } diff --git a/src/i18n/locales/tr/common.json b/src/i18n/locales/tr/common.json index 07d96db0c91..ae28de76cc3 100644 --- a/src/i18n/locales/tr/common.json +++ b/src/i18n/locales/tr/common.json @@ -96,5 +96,12 @@ "groqApiKey": "Groq API Anahtarı", "getGroqApiKey": "Groq API Anahtarı Al" } + }, + "ask": { + "autoApprovedRequestLimitReached": { + "title": "Otomatik Onaylı İstek Sınırına Ulaşıldı", + "description": "Roo, {{count}} otomatik onaylı API isteği sınırına ulaştı. Sayacı sıfırlayıp göreve devam etmek ister misiniz?", + "button": "Sıfırla ve Devam Et" + } } } diff --git a/src/i18n/locales/vi/common.json b/src/i18n/locales/vi/common.json index 3d6aac504c9..02c2b5fe87d 100644 --- a/src/i18n/locales/vi/common.json +++ b/src/i18n/locales/vi/common.json @@ -96,5 +96,12 @@ "groqApiKey": "Khóa API Groq", "getGroqApiKey": "Lấy khóa API Groq" } + }, + "ask": { + "autoApprovedRequestLimitReached": { + "title": "Đã đạt đến giới hạn yêu cầu được tự động phê duyệt", + "description": "Roo đã đạt đến giới hạn {{count}} yêu cầu API được tự động phê duyệt. Bạn có muốn đặt lại bộ đếm và tiếp tục tác vụ không?", + "button": "Đặt lại và Tiếp tục" + } } } diff --git a/src/i18n/locales/zh-CN/common.json b/src/i18n/locales/zh-CN/common.json index 62dcbbb6663..633747e2769 100644 --- a/src/i18n/locales/zh-CN/common.json +++ b/src/i18n/locales/zh-CN/common.json @@ -96,5 +96,12 @@ "groqApiKey": "Groq API 密钥", "getGroqApiKey": "获取 Groq API 密钥" } + }, + "ask": { + "autoApprovedRequestLimitReached": { + "title": "已达到自动批准请求上限", + "description": "Roo 已达到 {{count}} 个自动批准的 API 请求上限。您想重置计数并继续执行任务吗?", + "button": "重置并继续" + } } } diff --git a/src/i18n/locales/zh-TW/common.json b/src/i18n/locales/zh-TW/common.json index b40f9cb678f..479570607ec 100644 --- a/src/i18n/locales/zh-TW/common.json +++ b/src/i18n/locales/zh-TW/common.json @@ -96,5 +96,12 @@ "groqApiKey": "Groq API 金鑰", "getGroqApiKey": "取得 Groq API 金鑰" } + }, + "ask": { + "autoApprovedRequestLimitReached": { + "title": "已達到自動批准請求上限", + "description": "Roo 已達到 {{count}} 個自動批准的 API 請求上限。您想重設計數並繼續執行任務嗎?", + "button": "重設並繼續" + } } } diff --git a/src/schemas/index.ts b/src/schemas/index.ts index 0c0c21c62f2..64671be91ae 100644 --- a/src/schemas/index.ts +++ b/src/schemas/index.ts @@ -677,6 +677,7 @@ export const globalSettingsSchema = z.object({ alwaysAllowSubtasks: z.boolean().optional(), alwaysAllowExecute: z.boolean().optional(), allowedCommands: z.array(z.string()).optional(), + allowedMaxRequests: z.number().optional(), browserToolEnabled: z.boolean().optional(), browserViewportSize: z.string().optional(), @@ -756,6 +757,7 @@ const globalSettingsRecord: GlobalSettingsRecord = { alwaysAllowSubtasks: undefined, alwaysAllowExecute: undefined, allowedCommands: undefined, + allowedMaxRequests: undefined, browserToolEnabled: undefined, browserViewportSize: undefined, @@ -899,6 +901,7 @@ export const clineAsks = [ "mistake_limit_reached", "browser_action_launch", "use_mcp_server", + "auto_approval_max_req_reached", ] as const export const clineAskSchema = z.enum(clineAsks) diff --git a/src/shared/ExtensionMessage.ts b/src/shared/ExtensionMessage.ts index 6330556024a..11cdfde987b 100644 --- a/src/shared/ExtensionMessage.ts +++ b/src/shared/ExtensionMessage.ts @@ -131,6 +131,7 @@ export type ExtensionState = Pick< | "alwaysAllowSubtasks" | "alwaysAllowExecute" | "allowedCommands" + | "allowedMaxRequests" | "browserToolEnabled" | "browserViewportSize" | "screenshotQuality" diff --git a/src/shared/WebviewMessage.ts b/src/shared/WebviewMessage.ts index 22fe5c7d3e3..49a6b42f247 100644 --- a/src/shared/WebviewMessage.ts +++ b/src/shared/WebviewMessage.ts @@ -57,6 +57,7 @@ export interface WebviewMessage { | "alwaysAllowBrowser" | "alwaysAllowMcp" | "alwaysAllowModeSwitch" + | "allowedMaxRequests" | "alwaysAllowSubtasks" | "playSound" | "playTts" diff --git a/webview-ui/src/components/chat/AutoApproveMenu.tsx b/webview-ui/src/components/chat/AutoApproveMenu.tsx index aaa30a01530..aa6b41b3b1e 100644 --- a/webview-ui/src/components/chat/AutoApproveMenu.tsx +++ b/webview-ui/src/components/chat/AutoApproveMenu.tsx @@ -1,6 +1,6 @@ import { useCallback, useMemo, useState } from "react" import { Trans } from "react-i18next" -import { VSCodeCheckbox, VSCodeLink } from "@vscode/webview-ui-toolkit/react" +import { VSCodeCheckbox, VSCodeLink, VSCodeTextField } from "@vscode/webview-ui-toolkit/react" import { vscode } from "@src/utils/vscode" import { useExtensionState } from "@src/context/ExtensionStateContext" @@ -25,6 +25,7 @@ const AutoApproveMenu = ({ style }: AutoApproveMenuProps) => { alwaysAllowModeSwitch, alwaysAllowSubtasks, alwaysApproveResubmit, + allowedMaxRequests, setAlwaysAllowReadOnly, setAlwaysAllowWrite, setAlwaysAllowExecute, @@ -33,6 +34,7 @@ const AutoApproveMenu = ({ style }: AutoApproveMenuProps) => { setAlwaysAllowModeSwitch, setAlwaysAllowSubtasks, setAlwaysApproveResubmit, + setAllowedMaxRequests, } = useExtensionState() const { t } = useAppTranslation() @@ -196,6 +198,45 @@ const AutoApproveMenu = ({ style }: AutoApproveMenuProps) => { }} /> + + {/* Auto-approve API request count limit input row inspired by Cline */} +
+ Max Requests: + { + const input = e.target as HTMLInputElement + // Remove any non-numeric characters + input.value = input.value.replace(/[^0-9]/g, "") + const value = parseInt(input.value) + const parsedValue = !isNaN(value) && value > 0 ? value : undefined + setAllowedMaxRequests(parsedValue) + vscode.postMessage({ type: "allowedMaxRequests", value: parsedValue }) + }} + style={{ flex: 1 }} + /> +
+
+ +
+ )} diff --git a/webview-ui/src/components/chat/AutoApprovedRequestLimitWarning.tsx b/webview-ui/src/components/chat/AutoApprovedRequestLimitWarning.tsx new file mode 100644 index 00000000000..b84550fd2b9 --- /dev/null +++ b/webview-ui/src/components/chat/AutoApprovedRequestLimitWarning.tsx @@ -0,0 +1,40 @@ +import React, { memo } from "react" +import { VSCodeButton } from "@vscode/webview-ui-toolkit/react" +import { ClineMessage } from "@roo/shared/ExtensionMessage" +import { vscode } from "@src/utils/vscode" + +type AutoApprovedRequestLimitWarningProps = { + message: ClineMessage +} + +export const AutoApprovedRequestLimitWarning = memo(({ message }: AutoApprovedRequestLimitWarningProps) => { + const { title, description, button } = JSON.parse(message.text ?? "{}") + return ( + <> +
+ + {title} +
+ +
+
{description}
+ { + e.preventDefault() + vscode.postMessage({ type: "askResponse", askResponse: "yesButtonClicked" }) + }}> + {button} + +
+ + ) +}) diff --git a/webview-ui/src/components/chat/ChatRow.tsx b/webview-ui/src/components/chat/ChatRow.tsx index c6045087012..63ed2253544 100644 --- a/webview-ui/src/components/chat/ChatRow.tsx +++ b/webview-ui/src/components/chat/ChatRow.tsx @@ -31,6 +31,7 @@ import { ProgressIndicator } from "./ProgressIndicator" import { Markdown } from "./Markdown" import { CommandExecution } from "./CommandExecution" import { CommandExecutionError } from "./CommandExecutionError" +import { AutoApprovedRequestLimitWarning } from "./AutoApprovedRequestLimitWarning" import { ContextCondenseRow } from "./ContextCondenseRow" interface ChatRowProps { @@ -1086,6 +1087,9 @@ export const ChatRowContent = ({ /> ) + case "auto_approval_max_req_reached": { + return + } default: return null } diff --git a/webview-ui/src/components/settings/SettingsView.tsx b/webview-ui/src/components/settings/SettingsView.tsx index 735a5b67bad..f9c24252220 100644 --- a/webview-ui/src/components/settings/SettingsView.tsx +++ b/webview-ui/src/components/settings/SettingsView.tsx @@ -119,6 +119,7 @@ const SettingsView = forwardRef(({ onDone, t alwaysAllowReadOnly, alwaysAllowReadOnlyOutsideWorkspace, allowedCommands, + allowedMaxRequests, language, alwaysAllowBrowser, alwaysAllowExecute, @@ -246,6 +247,7 @@ const SettingsView = forwardRef(({ onDone, t vscode.postMessage({ type: "alwaysAllowBrowser", bool: alwaysAllowBrowser }) vscode.postMessage({ type: "alwaysAllowMcp", bool: alwaysAllowMcp }) vscode.postMessage({ type: "allowedCommands", commands: allowedCommands ?? [] }) + vscode.postMessage({ type: "allowedMaxRequests", value: allowedMaxRequests }) vscode.postMessage({ type: "browserToolEnabled", bool: browserToolEnabled }) vscode.postMessage({ type: "soundEnabled", bool: soundEnabled }) vscode.postMessage({ type: "ttsEnabled", bool: ttsEnabled }) diff --git a/webview-ui/src/context/ExtensionStateContext.tsx b/webview-ui/src/context/ExtensionStateContext.tsx index 63c895f034f..4194c9b11fc 100644 --- a/webview-ui/src/context/ExtensionStateContext.tsx +++ b/webview-ui/src/context/ExtensionStateContext.tsx @@ -39,6 +39,7 @@ export interface ExtensionStateContextType extends ExtensionState { setShowRooIgnoredFiles: (value: boolean) => void setShowAnnouncement: (value: boolean) => void setAllowedCommands: (value: string[]) => void + setAllowedMaxRequests: (value: number | undefined) => void setSoundEnabled: (value: boolean) => void setSoundVolume: (value: number) => void terminalShellIntegrationTimeout?: number @@ -133,6 +134,7 @@ export const ExtensionStateContextProvider: React.FC<{ children: React.ReactNode taskHistory: [], shouldShowAnnouncement: false, allowedCommands: [], + allowedMaxRequests: Infinity, soundEnabled: false, soundVolume: 0.5, ttsEnabled: false, @@ -288,6 +290,7 @@ export const ExtensionStateContextProvider: React.FC<{ children: React.ReactNode setAlwaysAllowSubtasks: (value) => setState((prevState) => ({ ...prevState, alwaysAllowSubtasks: value })), setShowAnnouncement: (value) => setState((prevState) => ({ ...prevState, shouldShowAnnouncement: value })), setAllowedCommands: (value) => setState((prevState) => ({ ...prevState, allowedCommands: value })), + setAllowedMaxRequests: (value) => setState((prevState) => ({ ...prevState, allowedMaxRequests: value })), setSoundEnabled: (value) => setState((prevState) => ({ ...prevState, soundEnabled: value })), setSoundVolume: (value) => setState((prevState) => ({ ...prevState, soundVolume: value })), setTtsEnabled: (value) => setState((prevState) => ({ ...prevState, ttsEnabled: value })), diff --git a/webview-ui/src/i18n/locales/ca/settings.json b/webview-ui/src/i18n/locales/ca/settings.json index d3160f05a36..5be89b1d1b9 100644 --- a/webview-ui/src/i18n/locales/ca/settings.json +++ b/webview-ui/src/i18n/locales/ca/settings.json @@ -79,6 +79,9 @@ "allowedCommandsDescription": "Prefixos de comandes que poden ser executats automàticament quan \"Aprovar sempre operacions d'execució\" està habilitat. Afegeix * per permetre totes les comandes (usar amb precaució).", "commandPlaceholder": "Introduïu prefix de comanda (ex. 'git ')", "addButton": "Afegir" + }, + "apiRequestLimit": { + "description": "Fes aquesta quantitat de sol·licituds API automàticament abans de demanar aprovació per continuar amb la tasca." } }, "providers": { diff --git a/webview-ui/src/i18n/locales/de/settings.json b/webview-ui/src/i18n/locales/de/settings.json index 1aa9c7ef59a..d9558227553 100644 --- a/webview-ui/src/i18n/locales/de/settings.json +++ b/webview-ui/src/i18n/locales/de/settings.json @@ -79,6 +79,9 @@ "allowedCommandsDescription": "Befehlspräfixe, die automatisch ausgeführt werden können, wenn 'Ausführungsoperationen immer genehmigen' aktiviert ist. Fügen Sie * hinzu, um alle Befehle zu erlauben (mit Vorsicht verwenden).", "commandPlaceholder": "Befehlspräfix eingeben (z.B. 'git ')", "addButton": "Hinzufügen" + }, + "apiRequestLimit": { + "description": "Führe automatisch diese Anzahl an API-Anfragen aus, bevor du um Genehmigung zur Fortsetzung der Aufgabe bitten musst." } }, "providers": { diff --git a/webview-ui/src/i18n/locales/en/settings.json b/webview-ui/src/i18n/locales/en/settings.json index 3a55588b111..1dfd84cd89d 100644 --- a/webview-ui/src/i18n/locales/en/settings.json +++ b/webview-ui/src/i18n/locales/en/settings.json @@ -79,6 +79,9 @@ "allowedCommandsDescription": "Command prefixes that can be auto-executed when \"Always approve execute operations\" is enabled. Add * to allow all commands (use with caution).", "commandPlaceholder": "Enter command prefix (e.g., 'git ')", "addButton": "Add" + }, + "apiRequestLimit": { + "description": "Automatically make this many API requests before asking for approval to continue with the task." } }, "providers": { diff --git a/webview-ui/src/i18n/locales/es/settings.json b/webview-ui/src/i18n/locales/es/settings.json index 033d1e40328..8b56fcba1be 100644 --- a/webview-ui/src/i18n/locales/es/settings.json +++ b/webview-ui/src/i18n/locales/es/settings.json @@ -79,6 +79,9 @@ "allowedCommandsDescription": "Prefijos de comandos que pueden ser ejecutados automáticamente cuando \"Aprobar siempre operaciones de ejecución\" está habilitado. Añade * para permitir todos los comandos (usar con precaución).", "commandPlaceholder": "Ingrese prefijo de comando (ej. 'git ')", "addButton": "Añadir" + }, + "apiRequestLimit": { + "description": "Realizar automáticamente esta cantidad de solicitudes a la API antes de pedir aprobación para continuar con la tarea." } }, "providers": { diff --git a/webview-ui/src/i18n/locales/fr/settings.json b/webview-ui/src/i18n/locales/fr/settings.json index 252f6daa769..23a65af5dba 100644 --- a/webview-ui/src/i18n/locales/fr/settings.json +++ b/webview-ui/src/i18n/locales/fr/settings.json @@ -79,6 +79,9 @@ "allowedCommandsDescription": "Préfixes de commandes qui peuvent être auto-exécutés lorsque \"Toujours approuver les opérations d'exécution\" est activé. Ajoutez * pour autoriser toutes les commandes (à utiliser avec précaution).", "commandPlaceholder": "Entrez le préfixe de commande (ex. 'git ')", "addButton": "Ajouter" + }, + "apiRequestLimit": { + "description": "Effectuer automatiquement ce nombre de requêtes API avant de demander l'approbation pour continuer la tâche." } }, "providers": { diff --git a/webview-ui/src/i18n/locales/hi/settings.json b/webview-ui/src/i18n/locales/hi/settings.json index 2beb4d147b5..fbfbafe94b3 100644 --- a/webview-ui/src/i18n/locales/hi/settings.json +++ b/webview-ui/src/i18n/locales/hi/settings.json @@ -79,6 +79,9 @@ "allowedCommandsDescription": "कमांड प्रीफिक्स जो स्वचालित रूप से निष्पादित किए जा सकते हैं जब \"निष्पादन ऑपरेशन हमेशा अनुमोदित करें\" सक्षम है। सभी कमांड की अनुमति देने के लिए * जोड़ें (सावधानी से उपयोग करें)।", "commandPlaceholder": "कमांड प्रीफिक्स दर्ज करें (उदा. 'git ')", "addButton": "जोड़ें" + }, + "apiRequestLimit": { + "description": "कार्य जारी रखने के लिए अनुमति मांगने से पहले स्वचालित रूप से इतने API अनुरोध करें।" } }, "providers": { diff --git a/webview-ui/src/i18n/locales/it/settings.json b/webview-ui/src/i18n/locales/it/settings.json index e5f9878b03d..0fa29891d71 100644 --- a/webview-ui/src/i18n/locales/it/settings.json +++ b/webview-ui/src/i18n/locales/it/settings.json @@ -79,6 +79,9 @@ "allowedCommandsDescription": "Prefissi di comando che possono essere auto-eseguiti quando \"Approva sempre operazioni di esecuzione\" è abilitato. Aggiungi * per consentire tutti i comandi (usare con cautela).", "commandPlaceholder": "Inserisci prefisso comando (es. 'git ')", "addButton": "Aggiungi" + }, + "apiRequestLimit": { + "description": "Esegui automaticamente questo numero di richieste API prima di chiedere l'approvazione per continuare con l'attività." } }, "providers": { diff --git a/webview-ui/src/i18n/locales/ja/settings.json b/webview-ui/src/i18n/locales/ja/settings.json index c71bbe666f9..6af0dedf153 100644 --- a/webview-ui/src/i18n/locales/ja/settings.json +++ b/webview-ui/src/i18n/locales/ja/settings.json @@ -79,6 +79,9 @@ "allowedCommandsDescription": "「実行操作を常に承認」が有効な場合に自動実行できるコマンドプレフィックス。すべてのコマンドを許可するには * を追加します(注意して使用してください)。", "commandPlaceholder": "コマンドプレフィックスを入力(例:'git ')", "addButton": "追加" + }, + "apiRequestLimit": { + "description": "タスクを続行するための承認を求める前に、この回数のAPIリクエストを自動的に実行します。" } }, "providers": { diff --git a/webview-ui/src/i18n/locales/ko/settings.json b/webview-ui/src/i18n/locales/ko/settings.json index 94bc2a49550..899d83c9419 100644 --- a/webview-ui/src/i18n/locales/ko/settings.json +++ b/webview-ui/src/i18n/locales/ko/settings.json @@ -79,6 +79,9 @@ "allowedCommandsDescription": "\"실행 작업 항상 승인\"이 활성화되었을 때 자동 실행될 수 있는 명령 접두사. 모든 명령을 허용하려면 * 추가(주의해서 사용)", "commandPlaceholder": "명령 접두사 입력(예: 'git ')", "addButton": "추가" + }, + "apiRequestLimit": { + "description": "작업을 계속 진행하기 위한 승인을 요청하기 전에 자동으로 이 정도의 API 요청을 수행합니다." } }, "providers": { diff --git a/webview-ui/src/i18n/locales/nl/settings.json b/webview-ui/src/i18n/locales/nl/settings.json index fd94d2e5d6e..28f523e1822 100644 --- a/webview-ui/src/i18n/locales/nl/settings.json +++ b/webview-ui/src/i18n/locales/nl/settings.json @@ -79,6 +79,9 @@ "allowedCommandsDescription": "Commando-prefixen die automatisch kunnen worden uitgevoerd als 'Altijd goedkeuren voor uitvoeren' is ingeschakeld. Voeg * toe om alle commando's toe te staan (gebruik met voorzichtigheid).", "commandPlaceholder": "Voer commando-prefix in (bijv. 'git ')", "addButton": "Toevoegen" + }, + "apiRequestLimit": { + "description": "Voer automatisch dit aantal API-verzoeken uit voordat je om goedkeuring vraagt om door te gaan met de taak." } }, "providers": { diff --git a/webview-ui/src/i18n/locales/pl/settings.json b/webview-ui/src/i18n/locales/pl/settings.json index 6f9959fa9da..dbdd0184ae0 100644 --- a/webview-ui/src/i18n/locales/pl/settings.json +++ b/webview-ui/src/i18n/locales/pl/settings.json @@ -79,6 +79,9 @@ "allowedCommandsDescription": "Prefiksy poleceń, które mogą być automatycznie wykonywane, gdy \"Zawsze zatwierdzaj operacje wykonania\" jest włączone. Dodaj * aby zezwolić na wszystkie polecenia (używaj z ostrożnością).", "commandPlaceholder": "Wprowadź prefiks polecenia (np. 'git ')", "addButton": "Dodaj" + }, + "apiRequestLimit": { + "description": "Automatycznie wykonaj tyle zapytań API, zanim poprosisz o zgodę na kontynuowanie zadania." } }, "providers": { diff --git a/webview-ui/src/i18n/locales/pt-BR/settings.json b/webview-ui/src/i18n/locales/pt-BR/settings.json index 54f48d413d9..31dd1e835d9 100644 --- a/webview-ui/src/i18n/locales/pt-BR/settings.json +++ b/webview-ui/src/i18n/locales/pt-BR/settings.json @@ -79,6 +79,9 @@ "allowedCommandsDescription": "Prefixos de comando que podem ser auto-executados quando \"Aprovar sempre operações de execução\" está ativado. Adicione * para permitir todos os comandos (use com cautela).", "commandPlaceholder": "Digite o prefixo do comando (ex. 'git ')", "addButton": "Adicionar" + }, + "apiRequestLimit": { + "description": "Fazer automaticamente este número de requisições à API antes de pedir aprovação para continuar com a tarefa." } }, "providers": { diff --git a/webview-ui/src/i18n/locales/ru/settings.json b/webview-ui/src/i18n/locales/ru/settings.json index 3d34d998834..6a24162a89c 100644 --- a/webview-ui/src/i18n/locales/ru/settings.json +++ b/webview-ui/src/i18n/locales/ru/settings.json @@ -79,6 +79,9 @@ "allowedCommandsDescription": "Префиксы команд, которые могут быть автоматически выполнены при включённом параметре \"Всегда одобрять выполнение операций\". Добавьте * для разрешения всех команд (используйте с осторожностью).", "commandPlaceholder": "Введите префикс команды (например, 'git ')", "addButton": "Добавить" + }, + "apiRequestLimit": { + "description": "Автоматически сделать это количество запросов к API перед запросом разрешения на продолжение задачи." } }, "providers": { diff --git a/webview-ui/src/i18n/locales/tr/settings.json b/webview-ui/src/i18n/locales/tr/settings.json index ac6f17a720c..6c1763e84f8 100644 --- a/webview-ui/src/i18n/locales/tr/settings.json +++ b/webview-ui/src/i18n/locales/tr/settings.json @@ -79,6 +79,9 @@ "allowedCommandsDescription": "\"Yürütme işlemlerini her zaman onayla\" etkinleştirildiğinde otomatik olarak yürütülebilen komut önekleri. Tüm komutlara izin vermek için * ekleyin (dikkatli kullanın).", "commandPlaceholder": "Komut öneki girin (örn. 'git ')", "addButton": "Ekle" + }, + "apiRequestLimit": { + "description": "Göreve devam etmek için onay istemeden önce bu sayıda API isteği otomatik olarak yap." } }, "providers": { diff --git a/webview-ui/src/i18n/locales/vi/settings.json b/webview-ui/src/i18n/locales/vi/settings.json index 482a70ba861..ac3cc925405 100644 --- a/webview-ui/src/i18n/locales/vi/settings.json +++ b/webview-ui/src/i18n/locales/vi/settings.json @@ -79,6 +79,9 @@ "allowedCommandsDescription": "Tiền tố lệnh có thể được tự động thực thi khi \"Luôn phê duyệt các hoạt động thực thi\" được bật. Thêm * để cho phép tất cả các lệnh (sử dụng cẩn thận).", "commandPlaceholder": "Nhập tiền tố lệnh (ví dụ: 'git ')", "addButton": "Thêm" + }, + "apiRequestLimit": { + "description": "Tự động thực hiện số lượng API request này trước khi yêu cầu phê duyệt để tiếp tục với nhiệm vụ." } }, "providers": { diff --git a/webview-ui/src/i18n/locales/zh-CN/settings.json b/webview-ui/src/i18n/locales/zh-CN/settings.json index e589a6874fb..f6d27de2091 100644 --- a/webview-ui/src/i18n/locales/zh-CN/settings.json +++ b/webview-ui/src/i18n/locales/zh-CN/settings.json @@ -79,6 +79,9 @@ "allowedCommandsDescription": "当\"自动批准命令行操作\"启用时可以自动执行的命令前缀。添加 * 以允许所有命令(谨慎使用)。", "commandPlaceholder": "输入命令前缀(例如 'git ')", "addButton": "添加" + }, + "apiRequestLimit": { + "description": "在请求批准继续任务前,自动执行这么多 API 请求。" } }, "providers": { diff --git a/webview-ui/src/i18n/locales/zh-TW/settings.json b/webview-ui/src/i18n/locales/zh-TW/settings.json index 5955c0bf49c..c51f8d85d23 100644 --- a/webview-ui/src/i18n/locales/zh-TW/settings.json +++ b/webview-ui/src/i18n/locales/zh-TW/settings.json @@ -79,6 +79,9 @@ "allowedCommandsDescription": "當「始終核准執行操作」啟用時可以自動執行的命令前綴。新增 * 以允許所有命令(請謹慎使用)。", "commandPlaceholder": "輸入命令前綴(例如 'git ')", "addButton": "新增" + }, + "apiRequestLimit": { + "description": "在要求核准繼續工作之前,自動發送這麼多 API 請求。" } }, "providers": { From 24e2903753fc65cb7dc71688366cf53d4806f79e Mon Sep 17 00:00:00 2001 From: Chris Hasson Date: Thu, 15 May 2025 21:39:44 -0700 Subject: [PATCH 2/6] =?UTF-8?q?=F0=9F=94=A7=20chore(gitignore):=20add=20ID?= =?UTF-8?q?E=20configuration=20files=20to=20ignore=20list?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - add .idea directory to ignore JetBrains IDE configurations --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index b2ddc6d9f0f..6e90445e1bd 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,9 @@ mock/ .DS_Store +# IDEs +.idea + # Builds bin/ roo-cline-*.vsix From e1a9c9afc03573546cfff0e38dd426c12ebf53b3 Mon Sep 17 00:00:00 2001 From: Chris Hasson Date: Tue, 20 May 2025 09:18:49 +0200 Subject: [PATCH 3/6] =?UTF-8?q?=F0=9F=8C=90=20i18n(chat):=20add=20translat?= =?UTF-8?q?ion=20keys=20for=20api=20request=20limit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - introduce translation keys for "title" and "unlimited" in multiple languages - update description for api request limit in various languages --- webview-ui/src/components/chat/AutoApproveMenu.tsx | 6 ++++-- webview-ui/src/i18n/locales/de/settings.json | 4 +++- webview-ui/src/i18n/locales/en/settings.json | 4 +++- webview-ui/src/i18n/locales/es/settings.json | 4 +++- webview-ui/src/i18n/locales/fr/settings.json | 4 +++- webview-ui/src/i18n/locales/hi/settings.json | 4 +++- webview-ui/src/i18n/locales/it/settings.json | 4 +++- webview-ui/src/i18n/locales/ja/settings.json | 4 +++- webview-ui/src/i18n/locales/ko/settings.json | 4 +++- webview-ui/src/i18n/locales/nl/settings.json | 4 +++- webview-ui/src/i18n/locales/pl/settings.json | 4 +++- webview-ui/src/i18n/locales/pt-BR/settings.json | 4 +++- webview-ui/src/i18n/locales/ru/settings.json | 4 +++- webview-ui/src/i18n/locales/tr/settings.json | 4 +++- webview-ui/src/i18n/locales/vi/settings.json | 4 +++- webview-ui/src/i18n/locales/zh-CN/settings.json | 4 +++- webview-ui/src/i18n/locales/zh-TW/settings.json | 4 +++- 17 files changed, 52 insertions(+), 18 deletions(-) diff --git a/webview-ui/src/components/chat/AutoApproveMenu.tsx b/webview-ui/src/components/chat/AutoApproveMenu.tsx index aa6b41b3b1e..e466088db2a 100644 --- a/webview-ui/src/components/chat/AutoApproveMenu.tsx +++ b/webview-ui/src/components/chat/AutoApproveMenu.tsx @@ -209,11 +209,13 @@ const AutoApproveMenu = ({ style }: AutoApproveMenuProps) => { marginBottom: "8px", color: "var(--vscode-descriptionForeground)", }}> - Max Requests: + + : + { diff --git a/webview-ui/src/i18n/locales/de/settings.json b/webview-ui/src/i18n/locales/de/settings.json index d9558227553..a3900ded3ab 100644 --- a/webview-ui/src/i18n/locales/de/settings.json +++ b/webview-ui/src/i18n/locales/de/settings.json @@ -81,7 +81,9 @@ "addButton": "Hinzufügen" }, "apiRequestLimit": { - "description": "Führe automatisch diese Anzahl an API-Anfragen aus, bevor du um Genehmigung zur Fortsetzung der Aufgabe bitten musst." + "title": "Maximale Anfragen", + "description": "Automatisch so viele API-Anfragen stellen, bevor du um die Erlaubnis gebeten wirst, mit der Aufgabe fortzufahren.", + "unlimited": "Unbegrenzt" } }, "providers": { diff --git a/webview-ui/src/i18n/locales/en/settings.json b/webview-ui/src/i18n/locales/en/settings.json index 1dfd84cd89d..1970a96a952 100644 --- a/webview-ui/src/i18n/locales/en/settings.json +++ b/webview-ui/src/i18n/locales/en/settings.json @@ -81,7 +81,9 @@ "addButton": "Add" }, "apiRequestLimit": { - "description": "Automatically make this many API requests before asking for approval to continue with the task." + "title": "Max Requests", + "description": "Automatically make this many API requests before asking for approval to continue with the task.", + "unlimited": "Unlimited" } }, "providers": { diff --git a/webview-ui/src/i18n/locales/es/settings.json b/webview-ui/src/i18n/locales/es/settings.json index 8b56fcba1be..7fd0f768de5 100644 --- a/webview-ui/src/i18n/locales/es/settings.json +++ b/webview-ui/src/i18n/locales/es/settings.json @@ -81,7 +81,9 @@ "addButton": "Añadir" }, "apiRequestLimit": { - "description": "Realizar automáticamente esta cantidad de solicitudes a la API antes de pedir aprobación para continuar con la tarea." + "title": "Solicitudes máximas", + "description": "Realizar automáticamente esta cantidad de solicitudes a la API antes de pedir aprobación para continuar con la tarea.", + "unlimited": "Ilimitado" } }, "providers": { diff --git a/webview-ui/src/i18n/locales/fr/settings.json b/webview-ui/src/i18n/locales/fr/settings.json index 23a65af5dba..6d4c298026d 100644 --- a/webview-ui/src/i18n/locales/fr/settings.json +++ b/webview-ui/src/i18n/locales/fr/settings.json @@ -81,7 +81,9 @@ "addButton": "Ajouter" }, "apiRequestLimit": { - "description": "Effectuer automatiquement ce nombre de requêtes API avant de demander l'approbation pour continuer la tâche." + "title": "Requêtes maximales", + "description": "Effectuer automatiquement ce nombre de requêtes API avant de demander l'approbation pour continuer la tâche.", + "unlimited": "Illimité" } }, "providers": { diff --git a/webview-ui/src/i18n/locales/hi/settings.json b/webview-ui/src/i18n/locales/hi/settings.json index fbfbafe94b3..3630ea8bb69 100644 --- a/webview-ui/src/i18n/locales/hi/settings.json +++ b/webview-ui/src/i18n/locales/hi/settings.json @@ -81,7 +81,9 @@ "addButton": "जोड़ें" }, "apiRequestLimit": { - "description": "कार्य जारी रखने के लिए अनुमति मांगने से पहले स्वचालित रूप से इतने API अनुरोध करें।" + "title": "अधिकतम अनुरोध", + "description": "कार्य जारी रखने के लिए अनुमति मांगने से पहले स्वचालित रूप से इतने API अनुरोध करें।", + "unlimited": "असीमित" } }, "providers": { diff --git a/webview-ui/src/i18n/locales/it/settings.json b/webview-ui/src/i18n/locales/it/settings.json index 0fa29891d71..7eb82ac52e0 100644 --- a/webview-ui/src/i18n/locales/it/settings.json +++ b/webview-ui/src/i18n/locales/it/settings.json @@ -81,7 +81,9 @@ "addButton": "Aggiungi" }, "apiRequestLimit": { - "description": "Esegui automaticamente questo numero di richieste API prima di chiedere l'approvazione per continuare con l'attività." + "title": "Richieste massime", + "description": "Esegui automaticamente questo numero di richieste API prima di chiedere l'approvazione per continuare con l'attività.", + "unlimited": "Illimitato" } }, "providers": { diff --git a/webview-ui/src/i18n/locales/ja/settings.json b/webview-ui/src/i18n/locales/ja/settings.json index 6af0dedf153..866ef10db89 100644 --- a/webview-ui/src/i18n/locales/ja/settings.json +++ b/webview-ui/src/i18n/locales/ja/settings.json @@ -81,7 +81,9 @@ "addButton": "追加" }, "apiRequestLimit": { - "description": "タスクを続行するための承認を求める前に、この回数のAPIリクエストを自動的に実行します。" + "title": "最大リクエスト数", + "description": "タスクを続行するための承認を求める前に、自動的にこの数のAPIリクエストを行います。", + "unlimited": "無制限" } }, "providers": { diff --git a/webview-ui/src/i18n/locales/ko/settings.json b/webview-ui/src/i18n/locales/ko/settings.json index 899d83c9419..d0d5a4348f1 100644 --- a/webview-ui/src/i18n/locales/ko/settings.json +++ b/webview-ui/src/i18n/locales/ko/settings.json @@ -81,7 +81,9 @@ "addButton": "추가" }, "apiRequestLimit": { - "description": "작업을 계속 진행하기 위한 승인을 요청하기 전에 자동으로 이 정도의 API 요청을 수행합니다." + "title": "최대 요청 수", + "description": "작업을 계속하기 위한 승인을 요청하기 전에 자동으로 이 수의 API 요청을 수행합니다.", + "unlimited": "무제한" } }, "providers": { diff --git a/webview-ui/src/i18n/locales/nl/settings.json b/webview-ui/src/i18n/locales/nl/settings.json index 28f523e1822..1b5b8d76b06 100644 --- a/webview-ui/src/i18n/locales/nl/settings.json +++ b/webview-ui/src/i18n/locales/nl/settings.json @@ -81,7 +81,9 @@ "addButton": "Toevoegen" }, "apiRequestLimit": { - "description": "Voer automatisch dit aantal API-verzoeken uit voordat je om goedkeuring vraagt om door te gaan met de taak." + "title": "Maximale verzoeken", + "description": "Voer automatisch dit aantal API-verzoeken uit voordat om goedkeuring wordt gevraagd om door te gaan met de taak.", + "unlimited": "Onbeperkt" } }, "providers": { diff --git a/webview-ui/src/i18n/locales/pl/settings.json b/webview-ui/src/i18n/locales/pl/settings.json index dbdd0184ae0..eca6c5dceb4 100644 --- a/webview-ui/src/i18n/locales/pl/settings.json +++ b/webview-ui/src/i18n/locales/pl/settings.json @@ -81,7 +81,9 @@ "addButton": "Dodaj" }, "apiRequestLimit": { - "description": "Automatycznie wykonaj tyle zapytań API, zanim poprosisz o zgodę na kontynuowanie zadania." + "title": "Maksymalna liczba żądań", + "description": "Automatycznie wykonaj tyle żądań API przed poproszeniem o zgodę na kontynuowanie zadania.", + "unlimited": "Bez limitu" } }, "providers": { diff --git a/webview-ui/src/i18n/locales/pt-BR/settings.json b/webview-ui/src/i18n/locales/pt-BR/settings.json index 31dd1e835d9..d0c67f45305 100644 --- a/webview-ui/src/i18n/locales/pt-BR/settings.json +++ b/webview-ui/src/i18n/locales/pt-BR/settings.json @@ -81,7 +81,9 @@ "addButton": "Adicionar" }, "apiRequestLimit": { - "description": "Fazer automaticamente este número de requisições à API antes de pedir aprovação para continuar com a tarefa." + "title": "Máximo de Solicitações", + "description": "Fazer automaticamente este número de requisições à API antes de pedir aprovação para continuar com a tarefa.", + "unlimited": "Ilimitado" } }, "providers": { diff --git a/webview-ui/src/i18n/locales/ru/settings.json b/webview-ui/src/i18n/locales/ru/settings.json index 6a24162a89c..41123e78625 100644 --- a/webview-ui/src/i18n/locales/ru/settings.json +++ b/webview-ui/src/i18n/locales/ru/settings.json @@ -81,7 +81,9 @@ "addButton": "Добавить" }, "apiRequestLimit": { - "description": "Автоматически сделать это количество запросов к API перед запросом разрешения на продолжение задачи." + "title": "Максимум запросов", + "description": "Автоматически выполнять это количество API-запросов перед запросом разрешения на продолжение задачи.", + "unlimited": "Без ограничений" } }, "providers": { diff --git a/webview-ui/src/i18n/locales/tr/settings.json b/webview-ui/src/i18n/locales/tr/settings.json index 6c1763e84f8..18979677d1d 100644 --- a/webview-ui/src/i18n/locales/tr/settings.json +++ b/webview-ui/src/i18n/locales/tr/settings.json @@ -81,7 +81,9 @@ "addButton": "Ekle" }, "apiRequestLimit": { - "description": "Göreve devam etmek için onay istemeden önce bu sayıda API isteği otomatik olarak yap." + "title": "Maksimum İstek", + "description": "Göreve devam etmek için onay istemeden önce bu sayıda API isteği otomatik olarak yap.", + "unlimited": "Sınırsız" } }, "providers": { diff --git a/webview-ui/src/i18n/locales/vi/settings.json b/webview-ui/src/i18n/locales/vi/settings.json index ac3cc925405..2fcd98af31f 100644 --- a/webview-ui/src/i18n/locales/vi/settings.json +++ b/webview-ui/src/i18n/locales/vi/settings.json @@ -81,7 +81,9 @@ "addButton": "Thêm" }, "apiRequestLimit": { - "description": "Tự động thực hiện số lượng API request này trước khi yêu cầu phê duyệt để tiếp tục với nhiệm vụ." + "title": "Số lượng yêu cầu tối đa", + "description": "Tự động thực hiện số lượng API request này trước khi yêu cầu phê duyệt để tiếp tục với nhiệm vụ.", + "unlimited": "Không giới hạn" } }, "providers": { diff --git a/webview-ui/src/i18n/locales/zh-CN/settings.json b/webview-ui/src/i18n/locales/zh-CN/settings.json index f6d27de2091..108c184bca9 100644 --- a/webview-ui/src/i18n/locales/zh-CN/settings.json +++ b/webview-ui/src/i18n/locales/zh-CN/settings.json @@ -81,7 +81,9 @@ "addButton": "添加" }, "apiRequestLimit": { - "description": "在请求批准继续任务前,自动执行这么多 API 请求。" + "title": "最大请求数", + "description": "在请求批准以继续执行任务之前,自动发出此数量的 API 请求。", + "unlimited": "无限制" } }, "providers": { diff --git a/webview-ui/src/i18n/locales/zh-TW/settings.json b/webview-ui/src/i18n/locales/zh-TW/settings.json index c51f8d85d23..d8f3f81cd18 100644 --- a/webview-ui/src/i18n/locales/zh-TW/settings.json +++ b/webview-ui/src/i18n/locales/zh-TW/settings.json @@ -81,7 +81,9 @@ "addButton": "新增" }, "apiRequestLimit": { - "description": "在要求核准繼續工作之前,自動發送這麼多 API 請求。" + "title": "最大請求數", + "description": "在請求批准以繼續執行工作之前,自動發出此數量的 API 請求。", + "unlimited": "無限制" } }, "providers": { From 34e008400f2f9cf7e75e86872412d1369cafdc4f Mon Sep 17 00:00:00 2001 From: Chris Hasson Date: Tue, 20 May 2025 10:52:10 +0200 Subject: [PATCH 4/6] =?UTF-8?q?=F0=9F=8C=90=20i18n(chat):=20migrate=20auto?= =?UTF-8?q?-approved=20request=20limit=20translations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - move translations from common.json to chat.json across locales - update component to use Trans for dynamic text rendering --- src/core/task/Task.ts | 10 +--------- src/i18n/locales/ca/common.json | 7 ------- src/i18n/locales/de/common.json | 7 ------- src/i18n/locales/en/common.json | 7 ------- src/i18n/locales/es/common.json | 7 ------- src/i18n/locales/fr/common.json | 7 ------- src/i18n/locales/hi/common.json | 7 ------- src/i18n/locales/it/common.json | 7 ------- src/i18n/locales/ja/common.json | 7 ------- src/i18n/locales/ko/common.json | 7 ------- src/i18n/locales/nl/common.json | 7 ------- src/i18n/locales/pl/common.json | 7 ------- src/i18n/locales/pt-BR/common.json | 7 ------- src/i18n/locales/ru/common.json | 7 ------- src/i18n/locales/tr/common.json | 7 ------- src/i18n/locales/vi/common.json | 7 ------- src/i18n/locales/zh-CN/common.json | 7 ------- src/i18n/locales/zh-TW/common.json | 7 ------- .../chat/AutoApprovedRequestLimitWarning.tsx | 13 +++++++++---- webview-ui/src/i18n/locales/ca/chat.json | 7 +++++++ webview-ui/src/i18n/locales/ca/settings.json | 4 +++- webview-ui/src/i18n/locales/de/chat.json | 7 +++++++ webview-ui/src/i18n/locales/en/chat.json | 7 +++++++ webview-ui/src/i18n/locales/es/chat.json | 7 +++++++ webview-ui/src/i18n/locales/fr/chat.json | 7 +++++++ webview-ui/src/i18n/locales/hi/chat.json | 7 +++++++ webview-ui/src/i18n/locales/it/chat.json | 7 +++++++ webview-ui/src/i18n/locales/ja/chat.json | 7 +++++++ webview-ui/src/i18n/locales/ko/chat.json | 7 +++++++ webview-ui/src/i18n/locales/nl/chat.json | 7 +++++++ webview-ui/src/i18n/locales/pl/chat.json | 7 +++++++ webview-ui/src/i18n/locales/pt-BR/chat.json | 7 +++++++ webview-ui/src/i18n/locales/ru/chat.json | 7 +++++++ webview-ui/src/i18n/locales/tr/chat.json | 7 +++++++ webview-ui/src/i18n/locales/vi/chat.json | 7 +++++++ webview-ui/src/i18n/locales/zh-CN/chat.json | 7 +++++++ webview-ui/src/i18n/locales/zh-TW/chat.json | 7 +++++++ 37 files changed, 132 insertions(+), 133 deletions(-) diff --git a/src/core/task/Task.ts b/src/core/task/Task.ts index 47565b0200b..4c12d5f311e 100644 --- a/src/core/task/Task.ts +++ b/src/core/task/Task.ts @@ -78,7 +78,6 @@ import { processUserContentMentions } from "../mentions/processUserContentMentio import { ApiMessage } from "../task-persistence/apiMessages" import { getMessagesSinceLastSummary } from "../condense" import { maybeRemoveImageBlocks } from "../../api/transform/image-cleaning" -import { t } from "../../i18n" export type ClineEvents = { message: [{ action: "created" | "updated"; message: ClineMessage }] @@ -1515,14 +1514,7 @@ export class Task extends EventEmitter { this.consecutiveAutoApprovedRequestsCount++ if (this.consecutiveAutoApprovedRequestsCount > maxRequests) { - const { response } = await this.ask( - "auto_approval_max_req_reached", - JSON.stringify({ - title: t("common:ask.autoApprovedRequestLimitReached.title"), - description: t("common:ask.autoApprovedRequestLimitReached.description", { count: maxRequests }), - button: t("common:ask.autoApprovedRequestLimitReached.button"), - }), - ) + const { response } = await this.ask("auto_approval_max_req_reached", JSON.stringify({ count: maxRequests })) // If we get past the promise, it means the user approved and did not start a new task if (response === "yesButtonClicked") { this.consecutiveAutoApprovedRequestsCount = 0 diff --git a/src/i18n/locales/ca/common.json b/src/i18n/locales/ca/common.json index 1ee81cfe053..c9994fdeaad 100644 --- a/src/i18n/locales/ca/common.json +++ b/src/i18n/locales/ca/common.json @@ -96,12 +96,5 @@ "groqApiKey": "Clau API de Groq", "getGroqApiKey": "Obté la clau API de Groq" } - }, - "ask": { - "autoApprovedRequestLimitReached": { - "title": "Límit de Sol·licituds Aprovades Automàticament Assolit", - "description": "Roo ha assolit el límit de {{count}} sol·licituds d'API aprovades automàticament. Vols restablir el comptador i continuar amb la tasca?", - "button": "Restablir i Continuar" - } } } diff --git a/src/i18n/locales/de/common.json b/src/i18n/locales/de/common.json index f40c455a892..982dc96da90 100644 --- a/src/i18n/locales/de/common.json +++ b/src/i18n/locales/de/common.json @@ -96,12 +96,5 @@ "groqApiKey": "Groq API-Schlüssel", "getGroqApiKey": "Groq API-Schlüssel erhalten" } - }, - "ask": { - "autoApprovedRequestLimitReached": { - "title": "Limit für automatisch genehmigte Anfragen erreicht", - "description": "Roo hat das Limit von {{count}} automatisch genehmigten API-Anfragen erreicht. Möchten Sie den Zähler zurücksetzen und mit der Aufgabe fortfahren?", - "button": "Zurücksetzen und Fortfahren" - } } } diff --git a/src/i18n/locales/en/common.json b/src/i18n/locales/en/common.json index 9b5dd7e5c98..06b371624b6 100644 --- a/src/i18n/locales/en/common.json +++ b/src/i18n/locales/en/common.json @@ -90,12 +90,5 @@ "input": { "task_prompt": "What should Roo do?", "task_placeholder": "Type your task here" - }, - "ask": { - "autoApprovedRequestLimitReached": { - "title": "Auto-Approved Request Limit Reached", - "description": "Roo has reached the auto-approved limit of {{count}} API requests. Would you like to reset the count and proceed with the task?", - "button": "Reset and Continue" - } } } diff --git a/src/i18n/locales/es/common.json b/src/i18n/locales/es/common.json index ff3788678af..ce4acbc7447 100644 --- a/src/i18n/locales/es/common.json +++ b/src/i18n/locales/es/common.json @@ -96,12 +96,5 @@ "groqApiKey": "Clave API de Groq", "getGroqApiKey": "Obtener clave API de Groq" } - }, - "ask": { - "autoApprovedRequestLimitReached": { - "title": "Límite de Solicitudes Aprobadas Automáticamente Alcanzado", - "description": "Roo ha alcanzado el límite de {{count}} solicitudes de API aprobadas automáticamente. ¿Te gustaría restablecer el contador y continuar con la tarea?", - "button": "Restablecer y Continuar" - } } } diff --git a/src/i18n/locales/fr/common.json b/src/i18n/locales/fr/common.json index 1679bee5072..262ef2659ff 100644 --- a/src/i18n/locales/fr/common.json +++ b/src/i18n/locales/fr/common.json @@ -96,12 +96,5 @@ "groqApiKey": "Clé API Groq", "getGroqApiKey": "Obtenir la clé API Groq" } - }, - "ask": { - "autoApprovedRequestLimitReached": { - "title": "Limite de Demandes Approuvées Automatiquement Atteinte", - "description": "Roo a atteint la limite de {{count}} demandes d'API approuvées automatiquement. Souhaitez-vous réinitialiser le compteur et poursuivre la tâche ?", - "button": "Réinitialiser et Continuer" - } } } diff --git a/src/i18n/locales/hi/common.json b/src/i18n/locales/hi/common.json index 587c9f957b1..9959b85f6e6 100644 --- a/src/i18n/locales/hi/common.json +++ b/src/i18n/locales/hi/common.json @@ -96,12 +96,5 @@ "groqApiKey": "ग्रोक एपीआई कुंजी", "getGroqApiKey": "ग्रोक एपीआई कुंजी प्राप्त करें" } - }, - "ask": { - "autoApprovedRequestLimitReached": { - "title": "स्वतः-अनुमोदित अनुरोध सीमा समाप्त", - "description": "Roo {{count}} स्वतः-अनुमोदित एपीआई अनुरोधों की सीमा तक पहुंच गया है। क्या आप गिनती रीसेट करना और कार्य के साथ आगे बढ़ना चाहेंगे?", - "button": "रीसेट करें और जारी रखें" - } } } diff --git a/src/i18n/locales/it/common.json b/src/i18n/locales/it/common.json index 7b0d0865f49..f3f9a0ce196 100644 --- a/src/i18n/locales/it/common.json +++ b/src/i18n/locales/it/common.json @@ -96,12 +96,5 @@ "groqApiKey": "Chiave API Groq", "getGroqApiKey": "Ottieni chiave API Groq" } - }, - "ask": { - "autoApprovedRequestLimitReached": { - "title": "Limite Richieste Approvate Automaticamente Raggiunto", - "description": "Roo ha raggiunto il limite di {{count}} richieste API approvate automaticamente. Vuoi reimpostare il conteggio e procedere con l'attività?", - "button": "Reimposta e Continua" - } } } diff --git a/src/i18n/locales/ja/common.json b/src/i18n/locales/ja/common.json index 196bcbc266d..fd1860a1de7 100644 --- a/src/i18n/locales/ja/common.json +++ b/src/i18n/locales/ja/common.json @@ -96,12 +96,5 @@ "groqApiKey": "Groq APIキー", "getGroqApiKey": "Groq APIキーを取得" } - }, - "ask": { - "autoApprovedRequestLimitReached": { - "title": "自動承認リクエスト上限に到達しました", - "description": "Rooは自動承認されたAPIリクエストの上限{{count}}件に達しました。カウントをリセットしてタスクを続行しますか?", - "button": "リセットして続行" - } } } diff --git a/src/i18n/locales/ko/common.json b/src/i18n/locales/ko/common.json index 01157efeb1a..4bea1be3b4f 100644 --- a/src/i18n/locales/ko/common.json +++ b/src/i18n/locales/ko/common.json @@ -96,12 +96,5 @@ "groqApiKey": "Groq API 키", "getGroqApiKey": "Groq API 키 받기" } - }, - "ask": { - "autoApprovedRequestLimitReached": { - "title": "자동 승인된 요청 한도 도달", - "description": "Roo가 자동 승인된 API 요청 한도인 {{count}}개에 도달했습니다. 횟수를 재설정하고 작업을 계속하시겠습니까?", - "button": "재설정하고 계속하기" - } } } diff --git a/src/i18n/locales/nl/common.json b/src/i18n/locales/nl/common.json index b5c4a291705..a758d149fa3 100644 --- a/src/i18n/locales/nl/common.json +++ b/src/i18n/locales/nl/common.json @@ -90,12 +90,5 @@ "input": { "task_prompt": "Wat moet Roo doen?", "task_placeholder": "Typ hier je taak" - }, - "ask": { - "autoApprovedRequestLimitReached": { - "button": "Reset en Doorgaan", - "description": "Roo heeft de automatisch goedgekeurde limiet van {{count}} API-aanvragen bereikt. Wilt u het aantal resetten en doorgaan met de taak?", - "title": "Limiet voor Automatisch Goedgekeurde Aanvragen Bereikt" - } } } diff --git a/src/i18n/locales/pl/common.json b/src/i18n/locales/pl/common.json index 179036127bd..1c4152f02d2 100644 --- a/src/i18n/locales/pl/common.json +++ b/src/i18n/locales/pl/common.json @@ -96,12 +96,5 @@ "groqApiKey": "Klucz API Groq", "getGroqApiKey": "Uzyskaj klucz API Groq" } - }, - "ask": { - "autoApprovedRequestLimitReached": { - "title": "Osiągnięto Limit Automatycznie Zatwierdzonych Żądań", - "description": "Roo osiągnął limit {{count}} automatycznie zatwierdzonych żądań API. Czy chcesz zresetować licznik i kontynuować zadanie?", - "button": "Zresetuj i Kontynuuj" - } } } diff --git a/src/i18n/locales/pt-BR/common.json b/src/i18n/locales/pt-BR/common.json index d3bdf74a33b..d80d5eaf12d 100644 --- a/src/i18n/locales/pt-BR/common.json +++ b/src/i18n/locales/pt-BR/common.json @@ -96,12 +96,5 @@ "groqApiKey": "Chave de API Groq", "getGroqApiKey": "Obter chave de API Groq" } - }, - "ask": { - "autoApprovedRequestLimitReached": { - "title": "Limite de Solicitações Aprovadas Automaticamente Atingido", - "description": "O Roo atingiu o limite de {{count}} solicitações de API aprovadas automaticamente. Gostaria de zerar a contagem e prosseguir com a tarefa?", - "button": "Zerar e Continuar" - } } } diff --git a/src/i18n/locales/ru/common.json b/src/i18n/locales/ru/common.json index c46ca41a963..c4c1b01de5f 100644 --- a/src/i18n/locales/ru/common.json +++ b/src/i18n/locales/ru/common.json @@ -96,12 +96,5 @@ "groqApiKey": "Ключ API Groq", "getGroqApiKey": "Получить ключ API Groq" } - }, - "ask": { - "autoApprovedRequestLimitReached": { - "button": "Сбросить и продолжить", - "title": "Достигнут лимит автоматически одобренных запросов", - "description": "Roo достиг автоматически одобренного лимита в {{count}} API запросов. Хотите сбросить счетчик и продолжить задачу?" - } } } diff --git a/src/i18n/locales/tr/common.json b/src/i18n/locales/tr/common.json index ae28de76cc3..07d96db0c91 100644 --- a/src/i18n/locales/tr/common.json +++ b/src/i18n/locales/tr/common.json @@ -96,12 +96,5 @@ "groqApiKey": "Groq API Anahtarı", "getGroqApiKey": "Groq API Anahtarı Al" } - }, - "ask": { - "autoApprovedRequestLimitReached": { - "title": "Otomatik Onaylı İstek Sınırına Ulaşıldı", - "description": "Roo, {{count}} otomatik onaylı API isteği sınırına ulaştı. Sayacı sıfırlayıp göreve devam etmek ister misiniz?", - "button": "Sıfırla ve Devam Et" - } } } diff --git a/src/i18n/locales/vi/common.json b/src/i18n/locales/vi/common.json index 02c2b5fe87d..3d6aac504c9 100644 --- a/src/i18n/locales/vi/common.json +++ b/src/i18n/locales/vi/common.json @@ -96,12 +96,5 @@ "groqApiKey": "Khóa API Groq", "getGroqApiKey": "Lấy khóa API Groq" } - }, - "ask": { - "autoApprovedRequestLimitReached": { - "title": "Đã đạt đến giới hạn yêu cầu được tự động phê duyệt", - "description": "Roo đã đạt đến giới hạn {{count}} yêu cầu API được tự động phê duyệt. Bạn có muốn đặt lại bộ đếm và tiếp tục tác vụ không?", - "button": "Đặt lại và Tiếp tục" - } } } diff --git a/src/i18n/locales/zh-CN/common.json b/src/i18n/locales/zh-CN/common.json index 633747e2769..62dcbbb6663 100644 --- a/src/i18n/locales/zh-CN/common.json +++ b/src/i18n/locales/zh-CN/common.json @@ -96,12 +96,5 @@ "groqApiKey": "Groq API 密钥", "getGroqApiKey": "获取 Groq API 密钥" } - }, - "ask": { - "autoApprovedRequestLimitReached": { - "title": "已达到自动批准请求上限", - "description": "Roo 已达到 {{count}} 个自动批准的 API 请求上限。您想重置计数并继续执行任务吗?", - "button": "重置并继续" - } } } diff --git a/src/i18n/locales/zh-TW/common.json b/src/i18n/locales/zh-TW/common.json index 479570607ec..b40f9cb678f 100644 --- a/src/i18n/locales/zh-TW/common.json +++ b/src/i18n/locales/zh-TW/common.json @@ -96,12 +96,5 @@ "groqApiKey": "Groq API 金鑰", "getGroqApiKey": "取得 Groq API 金鑰" } - }, - "ask": { - "autoApprovedRequestLimitReached": { - "title": "已達到自動批准請求上限", - "description": "Roo 已達到 {{count}} 個自動批准的 API 請求上限。您想重設計數並繼續執行任務嗎?", - "button": "重設並繼續" - } } } diff --git a/webview-ui/src/components/chat/AutoApprovedRequestLimitWarning.tsx b/webview-ui/src/components/chat/AutoApprovedRequestLimitWarning.tsx index b84550fd2b9..3bfb6ccd86d 100644 --- a/webview-ui/src/components/chat/AutoApprovedRequestLimitWarning.tsx +++ b/webview-ui/src/components/chat/AutoApprovedRequestLimitWarning.tsx @@ -2,18 +2,21 @@ import React, { memo } from "react" import { VSCodeButton } from "@vscode/webview-ui-toolkit/react" import { ClineMessage } from "@roo/shared/ExtensionMessage" import { vscode } from "@src/utils/vscode" +import { Trans } from "react-i18next" type AutoApprovedRequestLimitWarningProps = { message: ClineMessage } export const AutoApprovedRequestLimitWarning = memo(({ message }: AutoApprovedRequestLimitWarningProps) => { - const { title, description, button } = JSON.parse(message.text ?? "{}") + const { count } = JSON.parse(message.text ?? "{}") return ( <>
- {title} + + +
-
{description}
+
+ +
{ e.preventDefault() vscode.postMessage({ type: "askResponse", askResponse: "yesButtonClicked" }) }}> - {button} +
diff --git a/webview-ui/src/i18n/locales/ca/chat.json b/webview-ui/src/i18n/locales/ca/chat.json index dd0d89ced5f..4e9fdbee5d4 100644 --- a/webview-ui/src/i18n/locales/ca/chat.json +++ b/webview-ui/src/i18n/locales/ca/chat.json @@ -252,5 +252,12 @@ "title": "Advertència d'execució d'ordres", "description": "La teva ordre s'està executant sense la integració de shell del terminal VSCode. Per suprimir aquest advertiment, pots desactivar la integració de shell a la secció Terminal de la configuració de Roo Code o solucionar problemes d'integració del terminal VSCode utilitzant l'enllaç a continuació.", "troubleshooting": "Fes clic aquí per a la documentació d'integració de shell." + }, + "ask": { + "autoApprovedRequestLimitReached": { + "title": "S'ha arribat al límit de sol·licituds aprovades automàticament", + "description": "Roo ha arribat al límit aprovat automàticament de {{count}} sol·licitud(s) d'API. Vols reiniciar el comptador i continuar amb la tasca?", + "button": "Reiniciar i continuar" + } } } diff --git a/webview-ui/src/i18n/locales/ca/settings.json b/webview-ui/src/i18n/locales/ca/settings.json index 5be89b1d1b9..19c80356213 100644 --- a/webview-ui/src/i18n/locales/ca/settings.json +++ b/webview-ui/src/i18n/locales/ca/settings.json @@ -81,7 +81,9 @@ "addButton": "Afegir" }, "apiRequestLimit": { - "description": "Fes aquesta quantitat de sol·licituds API automàticament abans de demanar aprovació per continuar amb la tasca." + "title": "Màximes Sol·licituds", + "description": "Fes aquesta quantitat de sol·licituds API automàticament abans de demanar aprovació per continuar amb la tasca.", + "unlimited": "Il·limitat" } }, "providers": { diff --git a/webview-ui/src/i18n/locales/de/chat.json b/webview-ui/src/i18n/locales/de/chat.json index f683ada7d3d..435decc88f9 100644 --- a/webview-ui/src/i18n/locales/de/chat.json +++ b/webview-ui/src/i18n/locales/de/chat.json @@ -252,5 +252,12 @@ "title": "Befehlsausführungswarnung", "description": "Dein Befehl wird ohne VSCode Terminal-Shell-Integration ausgeführt. Um diese Warnung zu unterdrücken, kannst du die Shell-Integration im Abschnitt Terminal der Roo Code Einstellungen deaktivieren oder die VSCode Terminal-Integration mit dem Link unten beheben.", "troubleshooting": "Klicke hier für die Shell-Integrationsdokumentation." + }, + "ask": { + "autoApprovedRequestLimitReached": { + "title": "Limit für automatisch genehmigte Anfragen erreicht", + "description": "Roo hat das automatisch genehmigte Limit von {{count}} API-Anfrage(n) erreicht. Möchtest du den Zähler zurücksetzen und mit der Aufgabe fortfahren?", + "button": "Zurücksetzen und fortfahren" + } } } diff --git a/webview-ui/src/i18n/locales/en/chat.json b/webview-ui/src/i18n/locales/en/chat.json index 624381c8b0b..80302dfb2cc 100644 --- a/webview-ui/src/i18n/locales/en/chat.json +++ b/webview-ui/src/i18n/locales/en/chat.json @@ -252,5 +252,12 @@ "title": "Command Execution Warning", "description": "Your command is being executed without VSCode terminal shell integration. To suppress this warning you can disable shell integration in the Terminal section of the Roo Code settings or troubleshoot VSCode terminal integration using the link below.", "troubleshooting": "Click here for shell integration documentation." + }, + "ask": { + "autoApprovedRequestLimitReached": { + "title": "Auto-Approved Request Limit Reached", + "description": "Roo has reached the auto-approved limit of {{count}} API request(s). Would you like to reset the count and proceed with the task?", + "button": "Reset and Continue" + } } } diff --git a/webview-ui/src/i18n/locales/es/chat.json b/webview-ui/src/i18n/locales/es/chat.json index 7de76382416..ddc817f85d9 100644 --- a/webview-ui/src/i18n/locales/es/chat.json +++ b/webview-ui/src/i18n/locales/es/chat.json @@ -252,5 +252,12 @@ "title": "Advertencia de ejecución de comandos", "description": "Tu comando se está ejecutando sin la integración de shell de terminal de VSCode. Para suprimir esta advertencia, puedes desactivar la integración de shell en la sección Terminal de la configuración de Roo Code o solucionar problemas de integración de terminal de VSCode usando el enlace de abajo.", "troubleshooting": "Haz clic aquí para ver la documentación de integración de shell." + }, + "ask": { + "autoApprovedRequestLimitReached": { + "title": "Límite de Solicitudes Auto-aprobadas Alcanzado", + "description": "Roo ha alcanzado el límite auto-aprobado de {{count}} solicitud(es) API. ¿Deseas reiniciar el contador y continuar con la tarea?", + "button": "Reiniciar y Continuar" + } } } diff --git a/webview-ui/src/i18n/locales/fr/chat.json b/webview-ui/src/i18n/locales/fr/chat.json index bb1219e7ac1..2a116c8bf20 100644 --- a/webview-ui/src/i18n/locales/fr/chat.json +++ b/webview-ui/src/i18n/locales/fr/chat.json @@ -252,5 +252,12 @@ "title": "Avertissement d'exécution de commande", "description": "Votre commande est exécutée sans l'intégration shell du terminal VSCode. Pour supprimer cet avertissement, vous pouvez désactiver l'intégration shell dans la section Terminal des paramètres de Roo Code ou résoudre les problèmes d'intégration du terminal VSCode en utilisant le lien ci-dessous.", "troubleshooting": "Cliquez ici pour la documentation d'intégration shell." + }, + "ask": { + "autoApprovedRequestLimitReached": { + "title": "Limite de requêtes auto-approuvées atteinte", + "description": "Roo a atteint la limite auto-approuvée de {{count}} requête(s) API. Souhaitez-vous réinitialiser le compteur et poursuivre la tâche ?", + "button": "Réinitialiser et continuer" + } } } diff --git a/webview-ui/src/i18n/locales/hi/chat.json b/webview-ui/src/i18n/locales/hi/chat.json index 58bbd96b037..dfa7045b91e 100644 --- a/webview-ui/src/i18n/locales/hi/chat.json +++ b/webview-ui/src/i18n/locales/hi/chat.json @@ -252,5 +252,12 @@ "title": "कमांड निष्पादन चेतावनी", "description": "आपका कमांड VSCode टर्मिनल शेल इंटीग्रेशन के बिना निष्पादित हो रहा है। इस चेतावनी को दबाने के लिए आप Roo Code सेटिंग्स के Terminal अनुभाग में शेल इंटीग्रेशन को अक्षम कर सकते हैं या नीचे दिए गए लिंक का उपयोग करके VSCode टर्मिनल इंटीग्रेशन की समस्या का समाधान कर सकते हैं।", "troubleshooting": "शेल इंटीग्रेशन दस्तावेज़ के लिए यहां क्लिक करें।" + }, + "ask": { + "autoApprovedRequestLimitReached": { + "title": "स्वत:-स्वीकृत अनुरोध सीमा पहुंची", + "description": "Roo {{count}} API अनुरोध(धों) की स्वत:-स्वीकृत सीमा तक पहुंच गया है। क्या आप गणना को रीसेट करके कार्य जारी रखना चाहते हैं?", + "button": "रीसेट करें और जारी रखें" + } } } diff --git a/webview-ui/src/i18n/locales/it/chat.json b/webview-ui/src/i18n/locales/it/chat.json index 40a80ed188c..cb46a806fc2 100644 --- a/webview-ui/src/i18n/locales/it/chat.json +++ b/webview-ui/src/i18n/locales/it/chat.json @@ -252,5 +252,12 @@ "title": "Avviso di esecuzione comando", "description": "Il tuo comando viene eseguito senza l'integrazione shell del terminale VSCode. Per sopprimere questo avviso puoi disattivare l'integrazione shell nella sezione Terminal delle impostazioni di Roo Code o risolvere i problemi di integrazione del terminale VSCode utilizzando il link qui sotto.", "troubleshooting": "Clicca qui per la documentazione sull'integrazione shell." + }, + "ask": { + "autoApprovedRequestLimitReached": { + "title": "Limite di Richieste Auto-approvate Raggiunto", + "description": "Roo ha raggiunto il limite auto-approvato di {{count}} richiesta/e API. Vuoi reimpostare il contatore e procedere con l'attività?", + "button": "Reimposta e Continua" + } } } diff --git a/webview-ui/src/i18n/locales/ja/chat.json b/webview-ui/src/i18n/locales/ja/chat.json index 8bb0b09a1ef..080ea1b3ffe 100644 --- a/webview-ui/src/i18n/locales/ja/chat.json +++ b/webview-ui/src/i18n/locales/ja/chat.json @@ -252,5 +252,12 @@ "title": "コマンド実行警告", "description": "コマンドはVSCodeターミナルシェル統合なしで実行されています。この警告を非表示にするには、Roo Code設定Terminalセクションでシェル統合を無効にするか、以下のリンクを使用してVSCodeターミナル統合のトラブルシューティングを行ってください。", "troubleshooting": "シェル統合のドキュメントはこちらをクリック" + }, + "ask": { + "autoApprovedRequestLimitReached": { + "title": "自動承認リクエスト制限に達しました", + "description": "Rooは{{count}}件のAPI自動承認リクエスト制限に達しました。カウントをリセットしてタスクを続行しますか?", + "button": "リセットして続行" + } } } diff --git a/webview-ui/src/i18n/locales/ko/chat.json b/webview-ui/src/i18n/locales/ko/chat.json index b79038367ba..4f2e94b73ef 100644 --- a/webview-ui/src/i18n/locales/ko/chat.json +++ b/webview-ui/src/i18n/locales/ko/chat.json @@ -252,5 +252,12 @@ "title": "명령 실행 경고", "description": "명령이 VSCode 터미널 쉘 통합 없이 실행되고 있습니다. 이 경고를 숨기려면 Roo Code 설정Terminal 섹션에서 쉘 통합을 비활성화하거나 아래 링크를 사용하여 VSCode 터미널 통합 문제를 해결하세요.", "troubleshooting": "쉘 통합 문서를 보려면 여기를 클릭하세요." + }, + "ask": { + "autoApprovedRequestLimitReached": { + "title": "자동 승인 요청 한도 도달", + "description": "Roo가 {{count}}개의 API 요청(들)에 대한 자동 승인 한도에 도달했습니다. 카운트를 재설정하고 작업을 계속하시겠습니까?", + "button": "재설정 후 계속" + } } } diff --git a/webview-ui/src/i18n/locales/nl/chat.json b/webview-ui/src/i18n/locales/nl/chat.json index f69ce8b69cd..8e30baa57a7 100644 --- a/webview-ui/src/i18n/locales/nl/chat.json +++ b/webview-ui/src/i18n/locales/nl/chat.json @@ -252,5 +252,12 @@ "title": "Waarschuwing commando-uitvoering", "description": "Je commando wordt uitgevoerd zonder VSCode-terminal shell-integratie. Om deze waarschuwing te onderdrukken kun je shell-integratie uitschakelen in het gedeelte Terminal van de Roo Code-instellingen of de VSCode-terminalintegratie oplossen via de onderstaande link.", "troubleshooting": "Klik hier voor shell-integratie documentatie." + }, + "ask": { + "autoApprovedRequestLimitReached": { + "title": "Limiet voor automatisch goedgekeurde verzoeken bereikt", + "description": "Roo heeft de automatisch goedgekeurde limiet van {{count}} API-verzoek(en) bereikt. Wil je de teller resetten en doorgaan met de taak?", + "button": "Resetten en doorgaan" + } } } diff --git a/webview-ui/src/i18n/locales/pl/chat.json b/webview-ui/src/i18n/locales/pl/chat.json index c21898d50a5..96e48aba8bc 100644 --- a/webview-ui/src/i18n/locales/pl/chat.json +++ b/webview-ui/src/i18n/locales/pl/chat.json @@ -252,5 +252,12 @@ "title": "Ostrzeżenie wykonania polecenia", "description": "Twoje polecenie jest wykonywane bez integracji powłoki terminala VSCode. Aby ukryć to ostrzeżenie, możesz wyłączyć integrację powłoki w sekcji Terminal w ustawieniach Roo Code lub rozwiązać problemy z integracją terminala VSCode korzystając z poniższego linku.", "troubleshooting": "Kliknij tutaj, aby zobaczyć dokumentację integracji powłoki." + }, + "ask": { + "autoApprovedRequestLimitReached": { + "title": "Osiągnięto limit automatycznie zatwierdzonych żądań", + "description": "Roo osiągnął automatycznie zatwierdzony limit {{count}} żądania/żądań API. Czy chcesz zresetować licznik i kontynuować zadanie?", + "button": "Zresetuj i kontynuuj" + } } } diff --git a/webview-ui/src/i18n/locales/pt-BR/chat.json b/webview-ui/src/i18n/locales/pt-BR/chat.json index d25cc9962fc..a30d191c2e2 100644 --- a/webview-ui/src/i18n/locales/pt-BR/chat.json +++ b/webview-ui/src/i18n/locales/pt-BR/chat.json @@ -252,5 +252,12 @@ "title": "Aviso de execução de comando", "description": "Seu comando está sendo executado sem a integração de shell do terminal VSCode. Para suprimir este aviso, você pode desativar a integração de shell na seção Terminal das configurações do Roo Code ou solucionar problemas de integração do terminal VSCode usando o link abaixo.", "troubleshooting": "Clique aqui para a documentação de integração de shell." + }, + "ask": { + "autoApprovedRequestLimitReached": { + "title": "Limite de Solicitações Auto-aprovadas Atingido", + "description": "Roo atingiu o limite auto-aprovado de {{count}} solicitação(ões) de API. Deseja redefinir a contagem e prosseguir com a tarefa?", + "button": "Redefinir e Continuar" + } } } diff --git a/webview-ui/src/i18n/locales/ru/chat.json b/webview-ui/src/i18n/locales/ru/chat.json index 6e2345f8223..1248cc229f4 100644 --- a/webview-ui/src/i18n/locales/ru/chat.json +++ b/webview-ui/src/i18n/locales/ru/chat.json @@ -252,5 +252,12 @@ "title": "Предупреждение о выполнении команды", "description": "Ваша команда выполняется без интеграции оболочки терминала VSCode. Чтобы скрыть это предупреждение, вы можете отключить интеграцию оболочки в разделе Terminal в настройках Roo Code или устранить проблемы с интеграцией терминала VSCode, используя ссылку ниже.", "troubleshooting": "Нажмите здесь для просмотра документации по интеграции оболочки." + }, + "ask": { + "autoApprovedRequestLimitReached": { + "title": "Достигнут лимит автоматически одобренных запросов", + "description": "Roo достиг автоматически одобренного лимита в {{count}} API-запрос(ов). Хотите сбросить счетчик и продолжить задачу?", + "button": "Сбросить и продолжить" + } } } diff --git a/webview-ui/src/i18n/locales/tr/chat.json b/webview-ui/src/i18n/locales/tr/chat.json index d0171862581..a48c8aef86f 100644 --- a/webview-ui/src/i18n/locales/tr/chat.json +++ b/webview-ui/src/i18n/locales/tr/chat.json @@ -252,5 +252,12 @@ "title": "Komut Çalıştırma Uyarısı", "description": "Komutunuz VSCode terminal kabuk entegrasyonu olmadan çalıştırılıyor. Bu uyarıyı gizlemek için Roo Code ayarları'nın Terminal bölümünden kabuk entegrasyonunu devre dışı bırakabilir veya aşağıdaki bağlantıyı kullanarak VSCode terminal entegrasyonu sorunlarını giderebilirsiniz.", "troubleshooting": "Kabuk entegrasyonu belgelerini görmek için buraya tıklayın." + }, + "ask": { + "autoApprovedRequestLimitReached": { + "title": "Otomatik Onaylanan İstek Limiti Aşıldı", + "description": "Roo, {{count}} API isteği/istekleri için otomatik onaylanan limite ulaştı. Sayacı sıfırlamak ve göreve devam etmek istiyor musunuz?", + "button": "Sıfırla ve Devam Et" + } } } diff --git a/webview-ui/src/i18n/locales/vi/chat.json b/webview-ui/src/i18n/locales/vi/chat.json index 62bed81fc43..5038f554120 100644 --- a/webview-ui/src/i18n/locales/vi/chat.json +++ b/webview-ui/src/i18n/locales/vi/chat.json @@ -252,5 +252,12 @@ "title": "Cảnh báo thực thi lệnh", "description": "Lệnh của bạn đang được thực thi mà không có tích hợp shell terminal VSCode. Để ẩn cảnh báo này, bạn có thể vô hiệu hóa tích hợp shell trong phần Terminal của cài đặt Roo Code hoặc khắc phục sự cố tích hợp terminal VSCode bằng liên kết bên dưới.", "troubleshooting": "Nhấp vào đây để xem tài liệu tích hợp shell." + }, + "ask": { + "autoApprovedRequestLimitReached": { + "title": "Đã Đạt Giới Hạn Yêu Cầu Tự Động Phê Duyệt", + "description": "Roo đã đạt đến giới hạn tự động phê duyệt là {{count}} yêu cầu API. Bạn có muốn đặt lại bộ đếm và tiếp tục nhiệm vụ không?", + "button": "Đặt lại và Tiếp tục" + } } } diff --git a/webview-ui/src/i18n/locales/zh-CN/chat.json b/webview-ui/src/i18n/locales/zh-CN/chat.json index 31993895ac6..adffcfb482f 100644 --- a/webview-ui/src/i18n/locales/zh-CN/chat.json +++ b/webview-ui/src/i18n/locales/zh-CN/chat.json @@ -252,5 +252,12 @@ "title": "命令执行警告", "description": "您的命令正在没有 VSCode 终端 shell 集成的情况下执行。要隐藏此警告,您可以在 Roo Code 设置Terminal 部分禁用 shell 集成,或使用下方链接排查 VSCode 终端集成问题。", "troubleshooting": "点击此处查看 shell 集成文档。" + }, + "ask": { + "autoApprovedRequestLimitReached": { + "title": "已达自动批准请求限制", + "description": "Roo 已达到 {{count}} 次 API 请求的自动批准限制。您想重置计数并继续任务吗?", + "button": "重置并继续" + } } } diff --git a/webview-ui/src/i18n/locales/zh-TW/chat.json b/webview-ui/src/i18n/locales/zh-TW/chat.json index b3f94b9d819..2fddadce735 100644 --- a/webview-ui/src/i18n/locales/zh-TW/chat.json +++ b/webview-ui/src/i18n/locales/zh-TW/chat.json @@ -252,5 +252,12 @@ "title": "命令執行警告", "description": "您的命令正在沒有 VSCode 終端機 shell 整合的情況下執行。要隱藏此警告,您可以在 Roo Code 設定Terminal 部分停用 shell 整合,或使用下方連結排查 VSCode 終端機整合問題。", "troubleshooting": "點擊此處查看 shell 整合文件。" + }, + "ask": { + "autoApprovedRequestLimitReached": { + "title": "已達自動核准請求限制", + "description": "Roo 已達到 {{count}} 次 API 請求的自動核准限制。您想要重設計數並繼續工作嗎?", + "button": "重設並繼續" + } } } From 14c766809d5706f1aeb660d4c05c6cdc9e233b90 Mon Sep 17 00:00:00 2001 From: Matt Rubens Date: Tue, 20 May 2025 11:18:49 -0400 Subject: [PATCH 5/6] Update the UI for setting max requests --- webview-ui/src/components/chat/AutoApproveMenu.tsx | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/webview-ui/src/components/chat/AutoApproveMenu.tsx b/webview-ui/src/components/chat/AutoApproveMenu.tsx index e466088db2a..ac02d6b8c44 100644 --- a/webview-ui/src/components/chat/AutoApproveMenu.tsx +++ b/webview-ui/src/components/chat/AutoApproveMenu.tsx @@ -199,6 +199,8 @@ const AutoApproveMenu = ({ style }: AutoApproveMenuProps) => { /> + + {/* Auto-approve API request count limit input row inspired by Cline */}
{ : { const input = e.target as HTMLInputElement // Remove any non-numeric characters @@ -238,8 +237,6 @@ const AutoApproveMenu = ({ style }: AutoApproveMenuProps) => { }}>
- - )} From ea3d0d84edbe6fef195ff7d02ff48ab4db19e609 Mon Sep 17 00:00:00 2001 From: Matt Rubens Date: Tue, 20 May 2025 11:23:22 -0400 Subject: [PATCH 6/6] Hide the auto-approve limit warning once clicked --- .../components/chat/AutoApprovedRequestLimitWarning.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/webview-ui/src/components/chat/AutoApprovedRequestLimitWarning.tsx b/webview-ui/src/components/chat/AutoApprovedRequestLimitWarning.tsx index 3bfb6ccd86d..608646b266f 100644 --- a/webview-ui/src/components/chat/AutoApprovedRequestLimitWarning.tsx +++ b/webview-ui/src/components/chat/AutoApprovedRequestLimitWarning.tsx @@ -1,4 +1,4 @@ -import React, { memo } from "react" +import React, { memo, useState } from "react" import { VSCodeButton } from "@vscode/webview-ui-toolkit/react" import { ClineMessage } from "@roo/shared/ExtensionMessage" import { vscode } from "@src/utils/vscode" @@ -9,7 +9,13 @@ type AutoApprovedRequestLimitWarningProps = { } export const AutoApprovedRequestLimitWarning = memo(({ message }: AutoApprovedRequestLimitWarningProps) => { + const [buttonClicked, setButtonClicked] = useState(false) const { count } = JSON.parse(message.text ?? "{}") + + if (buttonClicked) { + return null + } + return ( <>
@@ -35,6 +41,7 @@ export const AutoApprovedRequestLimitWarning = memo(({ message }: AutoApprovedRe style={{ width: "100%", padding: "6px", borderRadius: "4px" }} onClick={(e) => { e.preventDefault() + setButtonClicked(true) vscode.postMessage({ type: "askResponse", askResponse: "yesButtonClicked" }) }}>