Explore Agentic Development - Join a GitHub Copilot Dev Day near you!
Dismiss this update
This article covers diagnostic tools and techniques for troubleshooting AI-related issues in VS Code. Use these tools to identify problems with network connectivity, customization files, and AI responses.
The log files for the GitHub Copilot extension are stored in the standard log location for Visual Studio Code extensions. Use these logs to diagnose connection issues, extension errors, and unexpected behavior.
To view detailed logs:
To switch between output channels, select GitHub Copilot or GitHub Copilot Chat from the dropdown menu on the right side of the Output panel.
If you encounter problems connecting to GitHub Copilot, collect network connectivity diagnostics to identify firewall, proxy, or VPN issues.
For more information about network configuration, see Network and firewall configuration for Copilot.
VS Code provides different tools to inspect what happens when you send a prompt to the AI.
/troubleshoot slash command:
Ask the AI to analyze the debug logs for the current chat session. Type /troubleshoot followed by your question, such as /troubleshoot how many tokens did I use? or /troubleshoot list all paths you tried to load customizations. Requires
github.copilot.chat.agentDebugLog.enabled
to be enabled.
Agent Debug Log panel (Preview):
Shows a chronological event log of agent interactions during a chat session, including tool call sequences, LLM requests, token usage, prompt file discovery, and errors. This is the primary tool for understanding and debugging chat interactions.
To open the Agent Debug Log panel:
From the Agent Debug Log panel, you can attach a snapshot of the agent debug events to a chat conversation to ask the AI questions about the session and troubleshoot a specific interaction.
Learn more about the Agent Debug Log panel.
Chat Debug view:
Shows the raw details of each LLM request and response, including the full system prompt, user prompt, context, and tool invocation payloads. Use this view to inspect the exact data sent to and received from the language model for each interaction.
To open the Chat Debug view:
...) in the Chat view.Learn more about the Chat Debug view.
MCP servers extend chat capabilities by connecting to external services. If an MCP server isn't working correctly, you can view its logs and restart it.
To troubleshoot MCP servers:
Learn more about configuring and debugging MCP servers.
If you encounter issues that you can't resolve, report them to help improve GitHub Copilot:
When reporting issues, include relevant information from the Copilot logs to help diagnose the problem.