INSIDE COPILOT AGENT MODE: 3-LAYER PROMPTS AND TOOL STRATEGY (OBSERVED VIA VS CODE CHAT DEBUG)
A log-based analysis using VS Code’s Chat Debug view shows GitHub Copilot Agent Mode builds prompts in three layers: a stable system prompt (policies and tool s...
A log-based analysis using VS Code’s Chat Debug view shows GitHub Copilot Agent Mode builds prompts in three layers: a stable system prompt (policies and tool strategy), workspace context (OS/repo/files), and the user request with extra artifacts. The system prompt guides tool use such as read_file (bulk reads), semantic_search (code discovery), grep_search (quick lookup), and fetch_webpage when URLs appear. These details are inferred from logs and may change with updates.
Knowing what context Copilot gathers and sends helps set privacy boundaries and improve answer quality.
Understanding tool selection clarifies latency/accuracy trade-offs and where retrieval might fail.
-
terminal
Use Chat Debug on a representative repo to verify which files, ranges, and URLs are read or sent during typical tasks.
-
terminal
Benchmark task success and latency when giving explicit file paths versus letting semantic_search discover code.