Skip to content

Anthropic prompts - consolidate <parallelizationStrategy>#314857

Draft
bhavyaus wants to merge 2 commits intomainfrom
dev/bhavyau/consolidate-anthropic-parallelization
Draft

Anthropic prompts - consolidate <parallelizationStrategy>#314857
bhavyaus wants to merge 2 commits intomainfrom
dev/bhavyau/consolidate-anthropic-parallelization

Conversation

@bhavyaus
Copy link
Copy Markdown
Collaborator

@bhavyaus bhavyaus commented May 6, 2026

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/7464

What changed

  • New 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).
  • Removed the duplicated parallel-call lines from <toolUseInstructions> in both Claude46OptimizedBasePrompt and Claude47OpusPrompt — they now live exclusively in the strategy block.
  • Wording strengthened from permissive ("you may parallelize... when appropriate") to imperative ("issue them in a single response... Maximize parallel tool calls where possible"), borrowed from the Claude Code system prompt.
  • Opus 4.6 picks up the over-search guard ("batch the reads you have already decided you need rather than searching speculatively") that previously only Sonnet 4.6 had.
  • Opus 4.7's <subagentFanOut> sub-tag is preserved verbatim, gated behind the helper's subagentFanOut: true option.

Test plan

  • Sonnet 4.6 eval run completes without regression on parallel Codebase / core_run_in_terminal / execution_subagent rates (must stay at 0)
  • Opus 4.6 eval run, same checks
  • Opus 4.7 eval run, same checks + subagent fan-out behavior unchanged

Copilot AI review requested due to automatic review settings May 6, 2026 21:46
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants