Skip to content

Commit 29eff78

Browse files
committed
Enable resetting the confirmation threshold to default via empty input, and update temperature and threshold input prompts
1 parent 39172b4 commit 29eff78

2 files changed

Lines changed: 13 additions & 5 deletions

File tree

packages/vscode/src/view/backend/message-handlers/handle-setup-api-tool-multi-config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,7 @@ export const handle_setup_api_tool_multi_config = async (params: {
656656
): Promise<number | undefined> {
657657
const temperature_input = await vscode.window.showInputBox({
658658
title: 'Set Temperature',
659-
prompt: 'Enter a value between 0 and 1 (required)',
659+
prompt: 'Enter a value between 0 and 1',
660660
value: temperature.toString(),
661661
placeHolder: '',
662662
validateInput: (value) => {

packages/vscode/src/view/backend/message-handlers/handle-setup-api-tool.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ export const handle_setup_api_tool = async (params: {
275275
): Promise<number | undefined> {
276276
const temperature_input = await vscode.window.showInputBox({
277277
title: 'Set Temperature',
278-
prompt: 'Enter a value between 0 and 1 (required)',
278+
prompt: 'Enter a value between 0 and 1',
279279
value: temperature.toString(),
280280
placeHolder: '',
281281
validateInput: (value) => {
@@ -298,10 +298,13 @@ export const handle_setup_api_tool = async (params: {
298298
): Promise<number | undefined> {
299299
const threshold_input = await vscode.window.showInputBox({
300300
title: 'Set Confirmation Threshold',
301-
prompt: 'Enter token count above which to ask for confirmation',
301+
prompt:
302+
'Enter token count above which to show affected fiels picker',
302303
value: current_threshold.toString(),
303-
placeHolder: 'e.g., 20000',
304304
validateInput: (value) => {
305+
// Allow empty value to restore default
306+
if (value == '') return null
307+
305308
const num = Number(value)
306309
if (isNaN(num)) return 'Please enter a valid number'
307310
if (num < 0) return 'Threshold must be 0 or greater'
@@ -310,10 +313,15 @@ export const handle_setup_api_tool = async (params: {
310313
}
311314
})
312315

313-
if (threshold_input === undefined || threshold_input === '') {
316+
if (threshold_input === undefined) {
314317
return undefined
315318
}
316319

320+
// If input is empty, return default threshold
321+
if (threshold_input === '') {
322+
return DEFAULT_CONFIRMATION_THRESHOLD
323+
}
324+
317325
return Number(threshold_input)
318326
}
319327
}

0 commit comments

Comments
 (0)