diff --git a/webview-ui/src/components/chat/AutoApproveMenu.tsx b/webview-ui/src/components/chat/AutoApproveMenu.tsx
index 0feafae15d..e6accfd87d 100644
--- a/webview-ui/src/components/chat/AutoApproveMenu.tsx
+++ b/webview-ui/src/components/chat/AutoApproveMenu.tsx
@@ -1,6 +1,6 @@
import { memo, useCallback, useMemo, useState } from "react"
import { Trans } from "react-i18next"
-import { VSCodeCheckbox, VSCodeLink, VSCodeTextField } from "@vscode/webview-ui-toolkit/react"
+import { VSCodeCheckbox, VSCodeLink } from "@vscode/webview-ui-toolkit/react"
import { vscode } from "@src/utils/vscode"
import { useExtensionState } from "@src/context/ExtensionStateContext"
@@ -21,7 +21,6 @@ const AutoApproveMenu = ({ style }: AutoApproveMenuProps) => {
autoApprovalEnabled,
setAutoApprovalEnabled,
alwaysApproveResubmit,
- allowedMaxRequests,
setAlwaysAllowReadOnly,
setAlwaysAllowWrite,
setAlwaysAllowExecute,
@@ -32,7 +31,6 @@ const AutoApproveMenu = ({ style }: AutoApproveMenuProps) => {
setAlwaysApproveResubmit,
setAlwaysAllowFollowupQuestions,
setAlwaysAllowUpdateTodoList,
- setAllowedMaxRequests,
} = useExtensionState()
const { t } = useAppTranslation()
@@ -242,43 +240,6 @@ 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
- 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/settings/AutoApproveSettings.tsx b/webview-ui/src/components/settings/AutoApproveSettings.tsx
index 1a93fee01a..afdb8851f1 100644
--- a/webview-ui/src/components/settings/AutoApproveSettings.tsx
+++ b/webview-ui/src/components/settings/AutoApproveSettings.tsx
@@ -1,8 +1,9 @@
import { HTMLAttributes, useState } from "react"
import { X } from "lucide-react"
+import { Trans } from "react-i18next"
import { useAppTranslation } from "@/i18n/TranslationContext"
-import { VSCodeCheckbox } from "@vscode/webview-ui-toolkit/react"
+import { VSCodeCheckbox, VSCodeTextField } from "@vscode/webview-ui-toolkit/react"
import { vscode } from "@/utils/vscode"
import { Button, Input, Slider, StandardTooltip } from "@/components/ui"
@@ -32,6 +33,7 @@ type AutoApproveSettingsProps = HTMLAttributes & {
followupAutoApproveTimeoutMs?: number
allowedCommands?: string[]
deniedCommands?: string[]
+ allowedMaxRequests?: number | null
setCachedStateField: SetCachedStateField<
| "alwaysAllowReadOnly"
| "alwaysAllowReadOnlyOutsideWorkspace"
@@ -50,6 +52,7 @@ type AutoApproveSettingsProps = HTMLAttributes & {
| "allowedCommands"
| "deniedCommands"
| "alwaysAllowUpdateTodoList"
+ | "allowedMaxRequests"
>
}
@@ -71,6 +74,7 @@ export const AutoApproveSettings = ({
alwaysAllowUpdateTodoList,
allowedCommands,
deniedCommands,
+ allowedMaxRequests,
setCachedStateField,
...props
}: AutoApproveSettingsProps) => {
@@ -374,6 +378,32 @@ export const AutoApproveSettings = ({
)}
+
+ {/* Max Requests Setting */}
+
+
+
+
{t("settings:autoApprove.apiRequestLimit.title")}
+
+
+ {
+ 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
+ setCachedStateField("allowedMaxRequests", parsedValue)
+ }}
+ style={{ flex: 1, maxWidth: "200px" }}
+ />
+
+
+
+
+
)
diff --git a/webview-ui/src/components/settings/SettingsView.tsx b/webview-ui/src/components/settings/SettingsView.tsx
index 9cfd9b64e5..13dc61ea95 100644
--- a/webview-ui/src/components/settings/SettingsView.tsx
+++ b/webview-ui/src/components/settings/SettingsView.tsx
@@ -628,6 +628,7 @@ const SettingsView = forwardRef(({ onDone, t
followupAutoApproveTimeoutMs={followupAutoApproveTimeoutMs}
allowedCommands={allowedCommands}
deniedCommands={deniedCommands}
+ allowedMaxRequests={allowedMaxRequests}
setCachedStateField={setCachedStateField}
/>
)}