Skip to content

Commit 9adfff2

Browse files
committed
prompt harder not to use write_file in ask mode
1 parent e82c715 commit 9adfff2

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

backend/src/main-prompt.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,15 @@ export const mainPrompt = async (
523523
role: 'user' as const,
524524
content: asSystemInstruction(toolInstructions),
525525
timeToLive: 'agentStep' as const,
526-
}
526+
},
527+
528+
isAskMode && {
529+
role: 'user',
530+
content: asSystemMessage(
531+
`You have been switched to ASK mode. As such, you can no longer use the write_file tool or run_terminal_command tool. Do not attempt to use them because they will not work!`
532+
),
533+
timeToLive: 'agentStep',
534+
}
527535
)
528536

529537
const iterationNum = messagesWithUserMessage.length
@@ -657,11 +665,7 @@ export const mainPrompt = async (
657665
if (
658666
isAskMode &&
659667
!isExporting &&
660-
[
661-
'write_file',
662-
'str_replace',
663-
'run_terminal_command',
664-
].includes(tool)
668+
['write_file', 'str_replace', 'run_terminal_command'].includes(tool)
665669
) {
666670
serverToolResults.push({
667671
name: tool,

0 commit comments

Comments
 (0)