Skip to content

Commit fb5d23c

Browse files
authored
Update examples for output formatting (#1182)
* Update examples for output formatting * Fix: Await modelCanUseMcpResultImageURL for effectiveToken determination in PrimitiveToolResult * Update snapshot
1 parent 57a4b4e commit fb5d23c

File tree

5 files changed

+68
-12
lines changed

5 files changed

+68
-12
lines changed

src/extension/prompts/node/agent/agentInstructions.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ export class DefaultAgentPrompt extends PromptElement<DefaultAgentPromptProps> {
143143
<>
144144
Before you edit an existing file, make sure you either already have it in the provided context, or read it with the {ToolName.ReadFile} tool, so that you can make proper changes.<br />
145145
{tools[ToolName.MultiReplaceString]
146-
? <>Use the {ToolName.ReplaceString} tool for single string replacements, paying attention to context to ensure your replacement is unique. Prefer the {ToolName.MultiReplaceString} tool when you need to make multiple string replacements across one or more files in a single operation. This is significantly more efficient than calling {ToolName.ReplaceString} multiple times and should be your first choice for: fixing similar patterns across files, applying consistent formatting changes, bulk refactoring operations, or any scenario where you need to make the same type of change in multiple places.<br /></>
146+
? <>Use the {ToolName.ReplaceString} tool for single string replacements, paying attention to context to ensure your replacement is unique. Prefer the {ToolName.MultiReplaceString} tool when you need to make multiple string replacements across one or more files in a single operation. This is significantly more efficient than calling {ToolName.ReplaceString} multiple times and should be your first choice for: fixing similar patterns across files, applying consistent formatting changes, bulk refactoring operations, or any scenario where you need to make the same type of change in multiple places. Do not announce which tool you're using (for example, avoid saying "I'll implement all the changes using multi_replace_string_in_file").<br /></>
147147
: isGrokCode
148148
? <>Use the {ToolName.ReplaceString} tool to edit files, paying attention to context to ensure your replacement is unique. You can use this tool multiple times per file. For optimal efficiency, group related edits into larger batches instead of making 10+ separate tool calls. When making several changes to the same file, strive to complete all necessary edits with as few tool calls as possible.<br /></>
149149
: <>Use the {ToolName.ReplaceString} tool to edit files, paying attention to context to ensure your replacement is unique. You can use this tool multiple times per file.<br /></>}
@@ -199,7 +199,9 @@ export class DefaultAgentPrompt extends PromptElement<DefaultAgentPromptProps> {
199199
If platform-specific acceleration applies, include an optional speed-up fenced block with commands. Close with a concise completion summary describing what changed and how it was verified (build/tests/linters), plus any follow-ups.<br />
200200
</>}
201201
<Tag name='example'>
202-
The class `Person` is in `src/models/person.ts`.
202+
The class `Person` is in `src/models/person.ts`.<br />
203+
The function `calculateTotal` is defined in `lib/utils/math.ts`.<br />
204+
You can find the configuration in `config/app.config.json`.
203205
</Tag>
204206
<MathIntegrationRules />
205207
</Tag>

src/extension/prompts/node/agent/agentPrompt.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,7 @@ export function getEditingReminder(hasEditFileTool: boolean, hasReplaceStringToo
738738
if (hasReplaceStringTool) {
739739
lines.push(<>
740740
When using the {ToolName.ReplaceString} tool, include 3-5 lines of unchanged code before and after the string you want to replace, to make it unambiguous which part of the file should be edited.<br />
741-
{hasMultiStringReplace && <>For maximum efficiency, whenever you plan to perform multiple independent edit operations, invoke them simultaneously using {ToolName.MultiReplaceString} tool rather than sequentially. This will greatly improve user's cost and time efficiency leading to a better user experience.<br /></>}
741+
{hasMultiStringReplace && <>For maximum efficiency, whenever you plan to perform multiple independent edit operations, invoke them simultaneously using {ToolName.MultiReplaceString} tool rather than sequentially. This will greatly improve user's cost and time efficiency leading to a better user experience. Do not announce which tool you're using (for example, avoid saying "I'll implement all the changes using multi_replace_string_in_file").<br /></>}
742742
</>);
743743
}
744744
if (hasEditFileTool && hasReplaceStringTool) {

0 commit comments

Comments
 (0)