@@ -14,7 +14,7 @@ import { getShortToolInstructions, getToolsInstructions } from '../tools'
1414
1515import { renderToolResults , ToolName } from '@codebuff/common/constants/tools'
1616import { ProjectFileContext } from '@codebuff/common/util/file'
17- import { generateCompactId } from '@codebuff/common/util/string'
17+ import { escapeString , generateCompactId } from '@codebuff/common/util/string'
1818import { agentTemplates } from './agent-list'
1919import {
2020 PLACEHOLDER ,
@@ -61,13 +61,13 @@ export async function formatPrompt(
6161 'agent'
6262 ) ,
6363 [ PLACEHOLDER . GIT_CHANGES_PROMPT ] : getGitChangesPrompt ( fileContext ) ,
64- [ PLACEHOLDER . USER_INPUT_PROMPT ] : lastUserInput ?? '' ,
6564 [ PLACEHOLDER . REMAINING_STEPS ] : `${ agentState . stepsRemaining ! } ` ,
6665 [ PLACEHOLDER . PROJECT_ROOT ] : fileContext . projectRoot ,
6766 [ PLACEHOLDER . SYSTEM_INFO_PROMPT ] : getSystemInfoPrompt ( fileContext ) ,
6867 [ PLACEHOLDER . TOOLS_PROMPT ] : getToolsInstructions ( tools , spawnableAgents ) ,
6968 [ PLACEHOLDER . USER_CWD ] : fileContext . cwd ,
70- [ PLACEHOLDER . INITIAL_AGENT_PROMPT ] : intitialAgentPrompt ?? '' ,
69+ [ PLACEHOLDER . USER_INPUT_PROMPT ] : escapeString ( lastUserInput ?? '' ) ,
70+ [ PLACEHOLDER . INITIAL_AGENT_PROMPT ] : escapeString ( intitialAgentPrompt ?? '' ) ,
7171 [ PLACEHOLDER . KNOWLEDGE_FILES_CONTENTS ] : renderToolResults (
7272 Object . entries ( {
7373 ...Object . fromEntries (
0 commit comments