Skip to content

Commit a320779

Browse files
committed
Remove the max concurrency setting from tool configurations and simplify the configuration editing user interface
1 parent b5993fe commit a320779

7 files changed

Lines changed: 62 additions & 95 deletions

File tree

‎apps/editor/package.json‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1819,9 +1819,6 @@
18191819
"isDefault": {
18201820
"type": "boolean"
18211821
},
1822-
"maxConcurrency": {
1823-
"type": "number"
1824-
},
18251822
"isPinned": {
18261823
"type": "boolean"
18271824
}

‎apps/editor/src/services/model-providers-manager.ts‎

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ export type ToolConfig = {
2525
model: string
2626
temperature?: number
2727
reasoning_effort?: ReasoningEffort
28-
max_concurrency?: number
2928
is_pinned?: boolean
3029
}
3130

@@ -34,8 +33,7 @@ export const get_tool_config_id = (config: ToolConfig): string => {
3433
config.provider_name,
3534
config.model,
3635
config.temperature,
37-
config.reasoning_effort ?? '',
38-
config.max_concurrency ?? ''
36+
config.reasoning_effort ?? ''
3937
]
4038
.filter((v) => v !== null && v !== undefined)
4139
.join(':')
@@ -163,7 +161,6 @@ export class ModelProvidersManager {
163161
model: string
164162
temperature?: number
165163
reasoningEffort?: ReasoningEffort
166-
maxConcurrency?: number
167164
isPinned?: boolean
168165
}[]
169166
>(settings_key, [])
@@ -177,7 +174,6 @@ export class ModelProvidersManager {
177174
model: sc.model,
178175
temperature: sc.temperature,
179176
reasoning_effort: sc.reasoningEffort,
180-
max_concurrency: sc.maxConcurrency,
181177
is_pinned: sc.isPinned
182178
}
183179
})
@@ -207,8 +203,6 @@ export class ModelProvidersManager {
207203
}
208204
if (c.reasoning_effort !== undefined)
209205
new_config.reasoningEffort = c.reasoning_effort
210-
if (c.max_concurrency !== undefined)
211-
new_config.maxConcurrency = c.max_concurrency
212206
if (c.is_pinned) new_config.isPinned = c.is_pinned
213207
return new_config
214208
})
@@ -229,9 +223,7 @@ export class ModelProvidersManager {
229223
settings_config.model === tool_config.model &&
230224
settings_config.temperature === tool_config.temperature &&
231225
(settings_config.reasoningEffort ?? undefined) ===
232-
(tool_config.reasoning_effort ?? undefined) &&
233-
(settings_config.maxConcurrency ?? undefined) ===
234-
(tool_config.max_concurrency ?? undefined)
226+
(tool_config.reasoning_effort ?? undefined)
235227
)
236228
}
237229

@@ -246,7 +238,6 @@ export class ModelProvidersManager {
246238
temperature?: number
247239
reasoningEffort?: ReasoningEffort
248240
isDefault?: boolean
249-
maxConcurrency?: number
250241
isPinned?: boolean
251242
}[]
252243
>(settings_key, [])
@@ -264,7 +255,6 @@ export class ModelProvidersManager {
264255
model: default_config_from_settings.model,
265256
temperature: default_config_from_settings.temperature,
266257
reasoning_effort: default_config_from_settings.reasoningEffort,
267-
max_concurrency: default_config_from_settings.maxConcurrency,
268258
is_pinned: default_config_from_settings.isPinned
269259
}
270260
const validated_config = this._validate_tool_config(tool_config)

‎apps/editor/src/views/panel/backend/message-handlers/handle-fix-all-failed-files.ts‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,7 @@ export const handle_fix_all_failed_files = async (
124124
.filter((item) => item.instructions && item.safe_path)
125125

126126
const max_concurrency =
127-
intelligent_update_config.max_concurrency ??
128-
(files_to_process.length > 0 ? files_to_process.length : 1)
127+
files_to_process.length > 0 ? files_to_process.length : 1
129128

130129
// Process in batches
131130
for (let i = 0; i < files_to_process.length; i += max_concurrency) {

‎apps/editor/src/views/panel/backend/message-handlers/handle-get-api-tool-configurations.ts‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ export const handle_get_api_tool_configurations = async (
3434
default_config.provider_name == config.provider_name &&
3535
default_config.model == config.model &&
3636
default_config.temperature == config.temperature &&
37-
default_config.reasoning_effort == config.reasoning_effort &&
38-
default_config.max_concurrency == config.max_concurrency
37+
default_config.reasoning_effort == config.reasoning_effort
3938
)
4039
}
4140

‎apps/editor/src/views/panel/types/messages.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ export type ApiToolConfiguration = {
3232
model: string
3333
temperature?: number
3434
reasoning_effort?: string
35-
max_concurrency?: number
3635
is_default?: boolean
3736
is_pinned?: boolean
3837
}

‎apps/editor/src/views/utils/config-editing.ts‎

Lines changed: 8 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export const initial_select_provider = async (
3333
const quick_pick =
3434
vscode.window.createQuickPick<(typeof provider_items)[0]>()
3535
quick_pick.items = provider_items
36-
quick_pick.title = 'Model Providers'
36+
quick_pick.title = 'Create New Configuration'
3737
quick_pick.placeholder = 'Select a model provider'
3838
const close_button: vscode.QuickInputButton = {
3939
iconPath: new vscode.ThemeIcon('close'),
@@ -99,7 +99,7 @@ export const initial_select_model = async (
9999
return await new Promise<string | undefined>((resolve) => {
100100
const quick_pick = vscode.window.createQuickPick()
101101
quick_pick.items = model_items
102-
quick_pick.title = 'Models'
102+
quick_pick.title = 'Create New Configuration'
103103
quick_pick.placeholder = 'Choose an AI model'
104104
quick_pick.buttons = [vscode.QuickInputButtons.Back]
105105
if (provider.name) {
@@ -157,7 +157,7 @@ export const initial_select_model = async (
157157
}
158158

159159
return await vscode.window.showInputBox({
160-
title: 'Enter Model Name',
160+
title: 'Create New Configuration',
161161
prompt: 'Could not fetch models. Please enter a model name (ID).'
162162
})
163163
}
@@ -177,7 +177,7 @@ export const edit_provider_for_config = async (
177177
const quick_pick =
178178
vscode.window.createQuickPick<(typeof provider_items)[0]>()
179179
quick_pick.items = provider_items
180-
quick_pick.title = 'Model Providers'
180+
quick_pick.title = 'Edit Configuration'
181181
quick_pick.placeholder = 'Select a model provider'
182182
quick_pick.buttons = [vscode.QuickInputButtons.Back]
183183
if (current_provider_name) {
@@ -265,7 +265,7 @@ export const edit_model_for_config = async (
265265
const quick_pick =
266266
vscode.window.createQuickPick<(typeof model_items)[0]>()
267267
quick_pick.items = model_items
268-
quick_pick.title = 'Models'
268+
quick_pick.title = 'Edit Configuration'
269269
quick_pick.placeholder = 'Choose a model'
270270
quick_pick.buttons = [vscode.QuickInputButtons.Back]
271271
if (config.model) {
@@ -335,7 +335,7 @@ export const edit_model_for_config = async (
335335
}
336336

337337
const new_model_input = await vscode.window.showInputBox({
338-
title: 'Enter Model Name',
338+
title: 'Edit Configuration',
339339
value: config.model,
340340
prompt: `Enter a model name (ID)`
341341
})
@@ -350,7 +350,7 @@ export const edit_temperature_for_config = async (
350350
): Promise<number | null | undefined> => {
351351
return await new Promise<number | null | undefined>((resolve) => {
352352
const input = vscode.window.createInputBox()
353-
input.title = 'Edit Temperature'
353+
input.title = 'Edit Configuration'
354354
input.value = config.temperature?.toString() ?? ''
355355
input.prompt = 'Enter a value between 0 and 2. Leave empty to unset.'
356356
input.buttons = [vscode.QuickInputButtons.Back]
@@ -421,7 +421,7 @@ export const edit_reasoning_effort_for_config = async (
421421
return await new Promise<string | null | undefined>((resolve) => {
422422
const quick_pick = vscode.window.createQuickPick()
423423
quick_pick.items = effort_options
424-
quick_pick.title = 'Reasoning Efforts'
424+
quick_pick.title = 'Edit Configuration'
425425
quick_pick.placeholder = 'Select reasoning effort'
426426
quick_pick.buttons = [vscode.QuickInputButtons.Back]
427427
if (current_effort) {
@@ -461,25 +461,3 @@ export const edit_reasoning_effort_for_config = async (
461461
quick_pick.show()
462462
})
463463
}
464-
465-
export const edit_max_concurrency_for_config = async (config: ToolConfig) => {
466-
const new_concurrency_str = await vscode.window.showInputBox({
467-
title: 'Edit Max Concurrency',
468-
value: config.max_concurrency?.toString() ?? '',
469-
prompt:
470-
'Enter a number for max concurrency. Leave empty or enter 0 to unset.',
471-
validateInput: (value) => {
472-
if (value === '') return null
473-
const num = parseInt(value, 10)
474-
if (isNaN(num) || !Number.isInteger(num) || num < 0) {
475-
return 'Please enter a whole number greater than or equal to 0.'
476-
}
477-
return null
478-
}
479-
})
480-
if (new_concurrency_str === undefined) return undefined
481-
if (new_concurrency_str === '') return null
482-
const val = parseInt(new_concurrency_str, 10)
483-
if (val === 0) return null
484-
return val
485-
}

‎apps/editor/src/views/utils/upsert-configuration.ts‎

Lines changed: 50 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import {
88
import { dictionary } from '@shared/constants/dictionary'
99
import { ModelFetcher } from '@/services/model-fetcher'
1010
import {
11-
edit_max_concurrency_for_config,
1211
edit_model_for_config,
1312
edit_provider_for_config,
1413
edit_reasoning_effort_for_config,
@@ -58,7 +57,7 @@ export const upsert_configuration = async (params: {
5857
providers_manager.get_intelligent_update_tool_configs()
5958
save_configs = (configs) =>
6059
providers_manager.save_intelligent_update_tool_configs(configs)
61-
advanced_options = ['Temperature', 'Reasoning Effort', 'Max Concurrency']
60+
advanced_options = ['Temperature', 'Reasoning Effort']
6261
break
6362
case 'prune-context':
6463
get_configs = () => providers_manager.get_prune_context_tool_configs()
@@ -177,9 +176,12 @@ export const upsert_configuration = async (params: {
177176
JSON.stringify(updated_config) !== JSON.stringify(starting_config)
178177

179178
const items: vscode.QuickPickItem[] = [
180-
{ label: 'Model Provider', detail: updated_config.provider_name },
181-
{ label: 'Model', detail: updated_config.model },
182-
{ label: 'Advanced' }
179+
{
180+
label: 'Model',
181+
description: updated_config.provider_name,
182+
detail: updated_config.model
183+
},
184+
{ label: 'More...' }
183185
]
184186

185187
const selected_item = await new Promise<vscode.QuickPickItem | undefined>(
@@ -224,11 +226,11 @@ export const upsert_configuration = async (params: {
224226
Object.assign(updated_config, starting_config)
225227
quick_pick.items = [
226228
{
227-
label: 'Model Provider',
228-
detail: updated_config.provider_name
229+
label: 'Model',
230+
description: updated_config.provider_name,
231+
detail: updated_config.model
229232
},
230-
{ label: 'Model', detail: updated_config.model },
231-
{ label: 'Advanced' }
233+
{ label: 'More...' }
232234
]
233235
quick_pick.buttons = [close_button]
234236
}
@@ -250,27 +252,46 @@ export const upsert_configuration = async (params: {
250252
last_selected_label = selected_item.label
251253
const selected_option = selected_item.label
252254

253-
if (selected_option == 'Model Provider') {
254-
const new_provider = await edit_provider_for_config(
255-
providers_manager,
256-
updated_config.provider_name
257-
)
258-
if (new_provider) {
259-
updated_config.provider_name = new_provider.provider_name
260-
updated_config.provider_type = new_provider.provider_type
261-
}
262-
} else if (selected_option == 'Model') {
263-
const new_model = await edit_model_for_config(
264-
updated_config,
265-
providers_manager,
266-
model_fetcher
267-
)
268-
if (new_model !== undefined) {
269-
updated_config.model = new_model
270-
}
271-
} else if (selected_option == 'Advanced') {
255+
if (selected_option == 'Model') {
256+
let current_provider_name = updated_config.provider_name
257+
272258
// eslint-disable-next-line no-constant-condition
259+
while (true) {
260+
const new_provider = await edit_provider_for_config(
261+
providers_manager,
262+
current_provider_name
263+
)
264+
265+
if (!new_provider) {
266+
break
267+
}
268+
269+
current_provider_name = new_provider.provider_name
270+
271+
const temp_config = {
272+
...updated_config,
273+
provider_name: new_provider.provider_name,
274+
provider_type: new_provider.provider_type,
275+
model:
276+
new_provider.provider_name === updated_config.provider_name
277+
? updated_config.model
278+
: ''
279+
}
280+
const new_model = await edit_model_for_config(
281+
temp_config,
282+
providers_manager,
283+
model_fetcher
284+
)
285+
if (new_model !== undefined) {
286+
updated_config.provider_name = new_provider.provider_name
287+
updated_config.provider_type = new_provider.provider_type
288+
updated_config.model = new_model
289+
break
290+
}
291+
}
292+
} else if (selected_option == 'More...') {
273293
let last_advanced_label: string | undefined
294+
// eslint-disable-next-line no-constant-condition
274295
while (true) {
275296
const advanced_items: vscode.QuickPickItem[] = []
276297
if (advanced_options.includes('Temperature')) {
@@ -287,22 +308,13 @@ export const upsert_configuration = async (params: {
287308
detail: updated_config.reasoning_effort
288309
})
289310
}
290-
if (advanced_options.includes('Max Concurrency')) {
291-
advanced_items.push({
292-
label: 'Max Concurrency',
293-
description: !updated_config.max_concurrency ? 'Unset' : undefined,
294-
detail: updated_config.max_concurrency?.toString() || undefined
295-
})
296-
}
297311

298312
const selected_advanced = await new Promise<
299313
vscode.QuickPickItem | undefined
300314
>((resolve) => {
301315
const quick_pick = vscode.window.createQuickPick()
302316
quick_pick.items = advanced_items
303-
quick_pick.title = original_id
304-
? 'Edit Configuration - Advanced'
305-
: 'Create New Configuration - Advanced'
317+
quick_pick.title = 'Edit Configuration'
306318
quick_pick.placeholder = 'Select a property to edit'
307319
quick_pick.buttons = [vscode.QuickInputButtons.Back]
308320
if (last_advanced_label) {
@@ -401,13 +413,6 @@ export const upsert_configuration = async (params: {
401413
break
402414
}
403415
}
404-
} else if (selected_advanced.label == 'Max Concurrency') {
405-
const new_concurrency =
406-
await edit_max_concurrency_for_config(updated_config)
407-
if (new_concurrency !== undefined) {
408-
updated_config.max_concurrency =
409-
new_concurrency === null ? undefined : new_concurrency
410-
}
411416
}
412417
}
413418
}

0 commit comments

Comments
 (0)