Skip to content

Commit 558e727

Browse files
committed
Put stepPrompt within <system-reminder> tags
1 parent e1da277 commit 558e727

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

backend/src/templates/strings.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ export async function getAgentPrompt<T extends StringField>({
162162
return undefined
163163
}
164164

165-
const prompt = await formatPrompt({
165+
let prompt = await formatPrompt({
166166
prompt: promptValue,
167167
fileContext,
168168
agentState,
@@ -174,6 +174,11 @@ export async function getAgentPrompt<T extends StringField>({
174174

175175
let addendum = ''
176176

177+
if (promptType.type === 'stepPrompt' && agentState.agentType) {
178+
// Put step prompt within a system-reminder tag so agent doesn't think the user just spoke again.
179+
prompt = `<system-reminder>${prompt}</system-reminder>`
180+
}
181+
177182
// Add tool instructions, spawnable agents, and output schema prompts to instructionsPrompt
178183
if (promptType.type === 'instructionsPrompt' && agentState.agentType) {
179184
const toolsInstructions = agentTemplate.inheritParentSystemPrompt

0 commit comments

Comments
 (0)