diff --git a/extensions/copilot/src/extension/prompts/node/agent/defaultAgentInstructions.tsx b/extensions/copilot/src/extension/prompts/node/agent/defaultAgentInstructions.tsx index f6b1794a39d..782f35c152f 100644 --- a/extensions/copilot/src/extension/prompts/node/agent/defaultAgentInstructions.tsx +++ b/extensions/copilot/src/extension/prompts/node/agent/defaultAgentInstructions.tsx @@ -487,7 +487,7 @@ export class ApplyPatchInstructions extends PromptElementIf you are stuck, you can fall back on the {ToolName.EditFile} tool, but {ToolName.ApplyPatch} is much faster and is the preferred tool.}
{isGpt5 && <>Prefer the smallest set of changes needed to satisfy the task. Avoid reformatting unrelated code; preserve existing style and public APIs unless the task requires changes. When practical, complete all edits for a file within a single message.
} {!useSimpleInstructions && <> - The input for this tool is a string representing the patch to apply, following a special format. For each snippet of code that needs to be changed, repeat the following:
+ The tool call requires both `input`, a string representing the patch to apply, and `explanation`, a short description of what the patch aims to achieve. The input follows a special format. For each snippet of code that needs to be changed, repeat the following:

NEVER print this out to the user, instead call the tool and the edits will be applied and shown to the user.
} diff --git a/extensions/copilot/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-default/all_tools.spec.snap b/extensions/copilot/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-default/all_tools.spec.snap index a48f31c1b16..373d4f66a04 100644 --- a/extensions/copilot/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-default/all_tools.spec.snap +++ b/extensions/copilot/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-default/all_tools.spec.snap @@ -43,7 +43,7 @@ Tools can be disabled by the user. You may see tools used previously in the conv To edit files in the workspace, use the apply_patch tool. If you have issues with it, you should first try to fix your patch and continue using apply_patch. If you are stuck, you can fall back on the insert_edit_into_file tool, but apply_patch is much faster and is the preferred tool. -The input for this tool is a string representing the patch to apply, following a special format. For each snippet of code that needs to be changed, repeat the following: +The tool call requires both `input`, a string representing the patch to apply, and `explanation`, a short description of what the patch aims to achieve. The input follows a special format. For each snippet of code that needs to be changed, repeat the following: *** Update File: [file_path] [context_before] -> See below for further instructions on context. -[old_code] -> Precede each line in the old code with a minus sign. diff --git a/extensions/copilot/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-gemini-2.0-flash/all_tools.spec.snap b/extensions/copilot/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-gemini-2.0-flash/all_tools.spec.snap index e468cf9bb92..5898d36baa8 100644 --- a/extensions/copilot/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-gemini-2.0-flash/all_tools.spec.snap +++ b/extensions/copilot/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-gemini-2.0-flash/all_tools.spec.snap @@ -39,7 +39,7 @@ Tools can be disabled by the user. You may see tools used previously in the conv To edit files in the workspace, use the apply_patch tool. If you have issues with it, you should first try to fix your patch and continue using apply_patch. If you are stuck, you can fall back on the insert_edit_into_file tool, but apply_patch is much faster and is the preferred tool. -The input for this tool is a string representing the patch to apply, following a special format. For each snippet of code that needs to be changed, repeat the following: +The tool call requires both `input`, a string representing the patch to apply, and `explanation`, a short description of what the patch aims to achieve. The input follows a special format. For each snippet of code that needs to be changed, repeat the following: *** Update File: [file_path] [context_before] -> See below for further instructions on context. -[old_code] -> Precede each line in the old code with a minus sign. diff --git a/extensions/copilot/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-gpt-4.1/all_tools.spec.snap b/extensions/copilot/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-gpt-4.1/all_tools.spec.snap index 65b9acb15d3..3cdc34624df 100644 --- a/extensions/copilot/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-gpt-4.1/all_tools.spec.snap +++ b/extensions/copilot/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-gpt-4.1/all_tools.spec.snap @@ -42,7 +42,7 @@ Tools can be disabled by the user. You may see tools used previously in the conv To edit files in the workspace, use the apply_patch tool. If you have issues with it, you should first try to fix your patch and continue using apply_patch. If you are stuck, you can fall back on the insert_edit_into_file tool, but apply_patch is much faster and is the preferred tool. -The input for this tool is a string representing the patch to apply, following a special format. For each snippet of code that needs to be changed, repeat the following: +The tool call requires both `input`, a string representing the patch to apply, and `explanation`, a short description of what the patch aims to achieve. The input follows a special format. For each snippet of code that needs to be changed, repeat the following: *** Update File: [file_path] [context_before] -> See below for further instructions on context. -[old_code] -> Precede each line in the old code with a minus sign. diff --git a/extensions/copilot/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-gpt-5-mini/all_tools.spec.snap b/extensions/copilot/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-gpt-5-mini/all_tools.spec.snap index e97ca52114e..a0dc988cc3f 100644 --- a/extensions/copilot/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-gpt-5-mini/all_tools.spec.snap +++ b/extensions/copilot/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-gpt-5-mini/all_tools.spec.snap @@ -151,7 +151,7 @@ The messages you send before tool calls should describe what is immediately abou To edit files in the workspace, use the apply_patch tool. If you have issues with it, you should first try to fix your patch and continue using apply_patch. If you are stuck, you can fall back on the insert_edit_into_file tool, but apply_patch is much faster and is the preferred tool. Prefer the smallest set of changes needed to satisfy the task. Avoid reformatting unrelated code; preserve existing style and public APIs unless the task requires changes. When practical, complete all edits for a file within a single message. -The input for this tool is a string representing the patch to apply, following a special format. For each snippet of code that needs to be changed, repeat the following: +The tool call requires both `input`, a string representing the patch to apply, and `explanation`, a short description of what the patch aims to achieve. The input follows a special format. For each snippet of code that needs to be changed, repeat the following: *** Update File: [file_path] [context_before] -> See below for further instructions on context. -[old_code] -> Precede each line in the old code with a minus sign. diff --git a/extensions/copilot/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-gpt-5.1/all_tools.spec.snap b/extensions/copilot/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-gpt-5.1/all_tools.spec.snap index ac5afdea246..c411a8f9e43 100644 --- a/extensions/copilot/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-gpt-5.1/all_tools.spec.snap +++ b/extensions/copilot/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-gpt-5.1/all_tools.spec.snap @@ -175,7 +175,7 @@ The class `Person` is in `src/models/person.ts`. To edit files in the workspace, use the apply_patch tool. If you have issues with it, you should first try to fix your patch and continue using apply_patch. If you are stuck, you can fall back on the insert_edit_into_file tool, but apply_patch is much faster and is the preferred tool. Prefer the smallest set of changes needed to satisfy the task. Avoid reformatting unrelated code; preserve existing style and public APIs unless the task requires changes. When practical, complete all edits for a file within a single message. -The input for this tool is a string representing the patch to apply, following a special format. For each snippet of code that needs to be changed, repeat the following: +The tool call requires both `input`, a string representing the patch to apply, and `explanation`, a short description of what the patch aims to achieve. The input follows a special format. For each snippet of code that needs to be changed, repeat the following: *** Update File: [file_path] [context_before] -> See below for further instructions on context. -[old_code] -> Precede each line in the old code with a minus sign. diff --git a/extensions/copilot/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-gpt-5/all_tools.spec.snap b/extensions/copilot/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-gpt-5/all_tools.spec.snap index 2170ecb5e34..e2b72919f2d 100644 --- a/extensions/copilot/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-gpt-5/all_tools.spec.snap +++ b/extensions/copilot/src/extension/prompts/node/agent/test/__snapshots__/agentPrompts-gpt-5/all_tools.spec.snap @@ -151,7 +151,7 @@ The messages you send before tool calls should describe what is immediately abou To edit files in the workspace, use the apply_patch tool. If you have issues with it, you should first try to fix your patch and continue using apply_patch. If you are stuck, you can fall back on the insert_edit_into_file tool, but apply_patch is much faster and is the preferred tool. Prefer the smallest set of changes needed to satisfy the task. Avoid reformatting unrelated code; preserve existing style and public APIs unless the task requires changes. When practical, complete all edits for a file within a single message. -The input for this tool is a string representing the patch to apply, following a special format. For each snippet of code that needs to be changed, repeat the following: +The tool call requires both `input`, a string representing the patch to apply, and `explanation`, a short description of what the patch aims to achieve. The input follows a special format. For each snippet of code that needs to be changed, repeat the following: *** Update File: [file_path] [context_before] -> See below for further instructions on context. -[old_code] -> Precede each line in the old code with a minus sign.