Skip to content

Commit 5d4197c

Browse files
committed
Remove configurable findRelevantFilesInstructions setting in favor of a constant
1 parent 907564d commit 5d4197c

16 files changed

Lines changed: 9 additions & 211 deletions

File tree

‎apps/editor/package.json‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -870,10 +870,6 @@
870870
"type": "string",
871871
"scope": "resource"
872872
},
873-
"codeWebChat.findRelevantFilesInstructions": {
874-
"type": "string",
875-
"scope": "resource"
876-
},
877873
"codeWebChat.fixAllAutomatically": {
878874
"type": "boolean",
879875
"scope": "resource",

‎apps/editor/src/commands/find-relevant-files-command.ts‎

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -431,16 +431,8 @@ export const find_relevant_files_command = (
431431
}
432432
xml_files += `</files>`
433433

434-
const config_settings =
435-
vscode.workspace.getConfiguration('codeWebChat')
436-
const config_find_relevant_files_instructions =
437-
config_settings.get<string>('findRelevantFilesInstructions')
438-
const instructions_to_use =
439-
config_find_relevant_files_instructions ||
440-
find_relevant_files_instructions
441-
442-
const system_instructions_xml = `${find_relevant_files_format}\n${instructions_to_use}`
443-
const part2 = `${system_instructions_xml}\nTask:\n${instructions}`
434+
const system_instructions_xml = `${find_relevant_files_format}\n${find_relevant_files_instructions}`
435+
const part2 = `${system_instructions_xml}\n${instructions}`
444436

445437
const user_content = build_user_content({
446438
provider_name: provider.name,

‎apps/editor/src/constants/instructions.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export const commit_message_instructions =
2929
"Write a brief and precise summary for the changes, limited to a single sentence. Because the summary will be used for a commit message, don't use any markdown formatting and don't include a trailing dot. Use an imperative tone to ensure clarity and focus on the primary change or purpose."
3030

3131
export const find_relevant_files_instructions =
32-
"Find all files building modules of the task's scope."
32+
"Find all files building modules of the following task's scope:"
3333

3434
export const find_relevant_files_format = `<system>
3535
Your response must contain paths of relevant files enclosed in "relevant-files" and "file-path" XML tags. Don't send anything else. Example:

‎apps/editor/src/views/panel/backend/message-handlers/handle-copy-prompt.ts‎

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -151,14 +151,7 @@ export const handle_copy_prompt = async (params: {
151151
system_instructions_xml = `<system>\n${edit_format_instructions}\n</system>`
152152
}
153153
} else if (is_in_find_relevant_files_prompt_type) {
154-
const config = vscode.workspace.getConfiguration('codeWebChat')
155-
const config_find_relevant_files_instructions = config.get<string>(
156-
'findRelevantFilesInstructions'
157-
)
158-
const instructions_to_use =
159-
config_find_relevant_files_instructions ||
160-
find_relevant_files_instructions
161-
system_instructions_xml = `${find_relevant_files_format_for_panel}\n${instructions_to_use}\nTask:`
154+
system_instructions_xml = `${find_relevant_files_format_for_panel}\n${find_relevant_files_instructions}`
162155
}
163156

164157
const text = context_text

‎apps/editor/src/views/panel/backend/message-handlers/handle-find-relevant-files.ts‎

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -355,17 +355,10 @@ export const handle_find_relevant_files = async (
355355

356356
const endpoint_url = provider.base_url
357357

358-
const config = vscode.workspace.getConfiguration('codeWebChat')
359-
const config_find_relevant_files_instructions = config.get<string>(
360-
'findRelevantFilesInstructions'
361-
)
362-
const instructions_to_use =
363-
config_find_relevant_files_instructions ||
364-
find_relevant_files_instructions
365-
const system_instructions_xml = `${find_relevant_files_format_for_panel}\n${instructions_to_use}`
358+
const system_instructions_xml = `${find_relevant_files_format_for_panel}\n${find_relevant_files_instructions}`
366359

367360
const part1 = `<files>\n${collected.other_files}`
368-
const part2 = `${collected.recent_files}</files>\n${skill_definitions}${system_instructions_xml}\nTask:\n${processed_instructions}`
361+
const part2 = `${collected.recent_files}</files>\n${skill_definitions}${system_instructions_xml}\n${processed_instructions}`
369362

370363
const user_content = build_user_content({
371364
provider_name: provider.name,

‎apps/editor/src/views/panel/backend/message-handlers/handle-send-to-browser.ts‎

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -196,14 +196,7 @@ export const handle_send_to_browser = async (params: {
196196
} else if (
197197
params.panel_provider.web_prompt_type == 'find-relevant-files'
198198
) {
199-
const config = vscode.workspace.getConfiguration('codeWebChat')
200-
const config_find_relevant_files_instructions = config.get<string>(
201-
'findRelevantFilesInstructions'
202-
)
203-
const instructions_to_use =
204-
config_find_relevant_files_instructions ||
205-
find_relevant_files_instructions
206-
system_instructions_xml = `${find_relevant_files_format_for_panel}\n${instructions_to_use}\nTask:`
199+
system_instructions_xml = `${find_relevant_files_format_for_panel}\n${find_relevant_files_instructions}`
207200
}
208201

209202
return {

‎apps/editor/src/views/settings/backend/message-handlers/handle-get-find-relevant-files-instructions.ts‎

Lines changed: 0 additions & 16 deletions
This file was deleted.

‎apps/editor/src/views/settings/backend/message-handlers/handle-update-find-relevant-files-instructions.ts‎

Lines changed: 0 additions & 18 deletions
This file was deleted.

‎apps/editor/src/views/settings/backend/message-handlers/index.ts‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,3 @@ export * from './handle-get-extended-cache-duration-for-anthropic'
4141
export * from './handle-update-extended-cache-duration-for-anthropic'
4242
export * from './handle-open-keybindings'
4343
export * from './handle-open-external-url'
44-
export * from './handle-get-find-relevant-files-instructions'
45-
export * from './handle-update-find-relevant-files-instructions'

‎apps/editor/src/views/settings/backend/settings-provider.ts‎

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,7 @@ import {
4646
handle_get_extended_cache_duration_for_anthropic,
4747
handle_update_extended_cache_duration_for_anthropic,
4848
handle_open_keybindings,
49-
handle_open_external_url,
50-
handle_get_find_relevant_files_instructions,
51-
handle_update_find_relevant_files_instructions
49+
handle_open_external_url
5250
} from './message-handlers'
5351

5452
export class SettingsProvider {
@@ -370,12 +368,6 @@ export class SettingsProvider {
370368
await handle_open_keybindings(message)
371369
} else if (message.command == 'OPEN_EXTERNAL_URL') {
372370
await handle_open_external_url(message)
373-
} else if (message.command == 'GET_FIND_RELEVANT_FILES_INSTRUCTIONS') {
374-
await handle_get_find_relevant_files_instructions(this)
375-
} else if (
376-
message.command == 'UPDATE_FIND_RELEVANT_FILES_INSTRUCTIONS'
377-
) {
378-
await handle_update_find_relevant_files_instructions(message)
379371
}
380372
},
381373
null,
@@ -420,7 +412,6 @@ export class SettingsProvider {
420412
void handle_get_are_automatic_checkpoints_disabled(this)
421413
void handle_get_checkpoint_lifespan(this)
422414
void handle_get_gemini_user_id(this)
423-
void handle_get_find_relevant_files_instructions(this)
424415
void handle_get_ai_studio_user_id(this)
425416
void handle_get_send_with_shift_enter(this)
426417
void handle_get_check_new_files(this)

0 commit comments

Comments
 (0)