You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
consttoolUseRef=skipXmlReferences ? "." : " without interfering with the TOOL USE guidelines."
115
118
returnjoinedSections
116
-
? `\n====\n\nUSER'S CUSTOM INSTRUCTIONS\n\nThe following additional instructions are provided by the user, and should be followed to the best of your ability without interfering with the TOOL USE guidelines.\n\n${joinedSections}`
119
+
? `\n====\n\nUSER'S CUSTOM INSTRUCTIONS\n\nThe following additional instructions are provided by the user, and should be followed to the best of your ability${toolUseRef}\n\n${joinedSections}`
`Access to ${path} is blocked by the .rooignore file settings. You must try to continue in the task without using this file, or ask the user to update the .rooignore file.`,
20
22
21
-
noToolsUsed: ()=>
22
-
`[ERROR] You did not use a tool in your previous response! Please retry with a tool use.
return`Missing value for required parameter '${paramName}'. Please retry with complete response.\n\n${instructions}`
45
+
},
46
+
47
+
lineCountTruncationError: (
48
+
actualLineCount: number,
49
+
isNewFile: boolean,
50
+
diffStrategyEnabled: boolean=false,
51
+
protocol?: ToolProtocol,
52
+
)=>{
40
53
consttruncationMessage=`Note: Your response may have been truncated because it exceeded your output limit. You wrote ${actualLineCount} lines of content, but the line_count parameter was either missing or not included in your response.`
41
54
42
55
constnewFileGuidance=
@@ -65,7 +78,9 @@ Otherwise, if you have not completed the task and do not need additional informa
Always use the actual tool name as the XML tag name for proper parsing and execution.`
238
+
239
+
consttoolUseInstructionsReminderNative=`# Reminder: Instructions for Tool Use
240
+
241
+
Tools are invoked using the platform's native tool calling mechanism. Each tool requires specific parameters as defined in the tool descriptions. Refer to the tool definitions provided in your system instructions for the correct parameter structure and usage examples.
242
+
243
+
Always ensure you provide all required parameters for the tool you wish to use.`
244
+
245
+
/**
246
+
* Gets the appropriate tool use instructions reminder based on the protocol.
247
+
*
248
+
* @param protocol - Optional tool protocol, falls back to default if not provided
249
+
* @returns The tool use instructions reminder text
The following additional instructions are provided by the user, and should be followed to the best of your ability without interfering with the TOOL USE guidelines.
380
+
The following additional instructions are provided by the user, and should be followed to the best of your ability${
381
+
isNativeProtocol(effectiveProtocol) ? "." : " without interfering with the TOOL USE guidelines."
@@ -45,6 +47,7 @@ export function getRulesSection(
45
47
supportsComputerUse: boolean,
46
48
diffStrategy?: DiffStrategy,
47
49
codeIndexManager?: CodeIndexManager,
50
+
settings?: SystemPromptSettings,
48
51
): string{
49
52
constisCodebaseSearchAvailable=
50
53
codeIndexManager&&
@@ -56,12 +59,15 @@ export function getRulesSection(
56
59
? "- **CRITICAL: For ANY exploration of code you haven't examined yet in this conversation, you MUST use the `codebase_search` tool FIRST before using search_files or other file exploration tools.** This requirement applies throughout the entire conversation, not just when starting a task. The codebase_search tool uses semantic search to find relevant code based on meaning, not just keywords, making it much more effective for understanding how features are implemented. Even if you've already explored some parts of the codebase, any new area or functionality you need to understand requires using codebase_search first.\n"
57
60
: ""
58
61
62
+
// Determine whether to use XML tool references based on protocol
- All file paths must be relative to this directory. However, commands may change directories in terminals, so respect working directory specified by the response to <execute_command>.
70
+
- All file paths must be relative to this directory. However, commands may change directories in terminals, so respect working directory specified by the response to ${isNativeProtocol(effectiveProtocol) ? "execute_command" : "<execute_command>"}.
65
71
- You cannot \`cd\` into a different directory to complete a task. You are stuck operating from '${cwd.toPosix()}', so be sure to pass in the correct 'path' parameter when using tools that require a path.
66
72
- Do not use the ~ character or $HOME to refer to the home directory.
67
73
- Before using the execute_command tool, you must first think about the SYSTEM INFORMATION context provided to understand the user's environment and tailor your commands to ensure they are compatible with their system. You must also consider if the command you need to run should be executed in a specific directory outside of the current working directory '${cwd.toPosix()}', and if so prepend with \`cd\`'ing into that directory && then executing the command (as one command since you are stuck operating from '${cwd.toPosix()}'). For example, if you needed to run \`npm install\` in a project outside of '${cwd.toPosix()}', you would need to prepend with a \`cd\` i.e. pseudocode for this would be \`cd (path to project) && (command, in this case npm install)\`.
0 commit comments