Anthropic prompts - consolidate <parallelizationStrategy>#314857
Draft
Anthropic prompts - consolidate <parallelizationStrategy>#314857
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Consolidates the <parallelizationStrategy> guidance for optimized Anthropic agent prompts into a single helper so that parallel tool-call rules, anti-oversearch guidance, and per-tool exceptions stay consistent across Sonnet 4.6 / Opus 4.6 / Opus 4.7.
Changes:
- Added
renderAnthropicParallelizationStrategy(tools, { subagentFanOut })as a single source of truth for parallelization + exceptions and (optionally) Opus 4.7 subagent fan-out guidance. - Updated Claude 4.6 optimized prompts (Sonnet/Opus) to delegate their strategy block to the shared helper, and adjusted the base class hook to accept
tools. - Removed duplicated parallelization/exceptions lines from
<toolUseInstructions>in Claude 4.6 optimized base and Claude 4.7 Opus prompt, keeping that guidance exclusively in the strategy block.
Show a summary per file
| File | Description |
|---|---|
| extensions/copilot/src/extension/prompts/node/agent/anthropicPrompts.tsx | Introduces a shared parallelization strategy renderer and wires optimized Anthropic prompts to use it, removing duplicated guidance text. |
Copilot's findings
- Files reviewed: 1/1 changed files
- Comments generated: 1
| {tools[ToolName.ExecutionSubagent] && <>Exception: do not call {ToolName.ExecutionSubagent} multiple times in parallel. Invoke one subagent and wait for its response before running the next.<br /></>} | ||
| {options.subagentFanOut && <Tag name='subagentFanOut'> | ||
| Do not spawn a subagent for work you can complete directly in a single response (e.g. refactoring a function you can already see).<br /> | ||
| Spawn multiple subagents in the same turn when fanning out across items or reading multiple files.<br /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Consolidating and cleaning up the
<parallelizationStrategy>block for the optimized Anthropic prompts (Sonnet 4.6, Opus 4.6, Opus 4.7). Tracking issue: https://github.com/microsoft/vscode-internalbacklog/issues/7464What changed
renderAnthropicParallelizationStrategy(tools, { subagentFanOut })helper — single source of truth for the parallel-call rule, the over-search guard, and the per-tool carve-outs (Codebase,core_run_in_terminal,execution_subagent).<toolUseInstructions>in bothClaude46OptimizedBasePromptandClaude47OpusPrompt— they now live exclusively in the strategy block.<subagentFanOut>sub-tag is preserved verbatim, gated behind the helper'ssubagentFanOut: trueoption.Test plan
Codebase/core_run_in_terminal/execution_subagentrates (must stay at 0)