Skip to content

Commit ae231a1

Browse files
committed
Add file editing prohibition requirement to agentic search prompt
- 'agentic search' should include requirements section that tells it that making edits in this session is forbidden.
1 parent 74c9ae2 commit ae231a1

3 files changed

Lines changed: 12 additions & 2 deletions

File tree

‎README.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,10 @@ In the project, find the complete set of primary and structural files relevant t
101101
102102
Output strictly as a bulleted list of file paths without explanations or any other text (e.g., - `path/to/file.ext`).
103103
104+
# Requirements
105+
106+
- Editing files in this session is FORBIDDEN.
107+
104108
# Query
105109
106110
[INSTRUCTIONS]

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,6 @@ export const cli_edit_ask_requirements = {
8080
exception_allow_file_system_operations:
8181
'EXCEPTION: Perform file system operations (create, update, delete, rename, move) required to complete the [task](#task).'
8282
}
83+
84+
export const agentic_search_requirements =
85+
'Editing files in this session is FORBIDDEN.'

‎apps/editor/src/features/agentic-search/utils/build-agent-prompt.ts‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import * as vscode from 'vscode'
2-
import { ai_file_search_format_instructions } from '@/constants/instructions'
2+
import {
3+
agentic_search_requirements,
4+
ai_file_search_format_instructions
5+
} from '@/constants/instructions'
36

47
export const build_agent_prompt = (
58
query: string,
@@ -12,7 +15,7 @@ export const build_agent_prompt = (
1215
config.inspect<string>('agenticSearchInstructions')?.defaultValue ||
1316
''
1417

15-
let prompt = `# Task\n\n${task_instructions}\n\n# Output formatting\n\n${ai_file_search_format_instructions}`
18+
let prompt = `# Task\n\n${task_instructions}\n\n# Output formatting\n\n${ai_file_search_format_instructions}\n\n# Requirements\n\n- ${agentic_search_requirements}`
1619

1720
prompt += `\n\n# Query\n\n${query}`
1821

0 commit comments

Comments
 (0)