Troubleshoot AI in Visual Studio Code
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.
View logs for GitHub Copilot
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:
- Open the Command Palette (⇧⌘P (Windows, LinuxCtrl+Shift+P)).
- RunDeveloper: Set Log Level and set the value toTrace for the GitHub Copilot and GitHub Copilot Chat extensions.
- RunOutput: Show Output Channels and select eitherGitHub Copilot orGitHub Copilot Chat from the list.
- In the Output panel, view the logs for the selected extension.
To switch between output channels, selectGitHub Copilot orGitHub Copilot Chat from the dropdown menu on the right side of the Output panel.
Collect network diagnostics
If you encounter problems connecting to GitHub Copilot, collect network connectivity diagnostics to identify firewall, proxy, or VPN issues.
- Open the Command Palette (⇧⌘P (Windows, LinuxCtrl+Shift+P)).
- RunGitHub Copilot: Collect Diagnostics.
- An editor tab opens with diagnostic information you can review and share when reporting issues.
For more information about network configuration, seeNetwork and firewall configuration for Copilot.
Chat Debug view
The Chat Debug view shows the details of AI requests and responses, including the system prompt, user prompt, context sent to the language model, and tool invocations. Use this view to understand how the AI interprets your requests and what context it uses to generate responses.
To open the Chat Debug view:
- Select the overflow menu (
...) in the Chat view. - SelectShow Chat Debug View.
Alternatively, runDeveloper: Show Chat Debug View from the Command Palette.
Learn more about theChat Debug view.
Chat customization diagnostics
The chat customization diagnostics view shows all currently loaded custom agents, prompt files, instruction files, and skills. Use this view to troubleshoot issues with customization files that aren't being applied or are causing errors.
To open the diagnostics view:
- Right-click in the Chat view.
- SelectDiagnostics.
This opens a markdown document listing:
- All active customization files and their locations
- Load status for each file (loaded, failed, or skipped)
- Error messages for files that failed to load
- The order in which instructions are applied
If a customization file isn't being applied, check the diagnostics view to verify it was loaded successfully and review any error messages.
Troubleshoot MCP servers
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:
- Open the Command Palette and runMCP: List Servers.
- Select a server to view its status and available actions.
- SelectShow Output to view the server's logs.
- SelectRestart Server to restart a misbehaving server.
Learn more aboutconfiguring and debugging MCP servers.
Provide feedback
If you encounter issues that you can't resolve, report them to help improve GitHub Copilot:
- Ghost text suggestions: Hover over a ghost text suggestion in the editor and selectSend Copilot Completion Feedback.
- Next edit suggestions: Select theFeedback action in the next edit suggestions menu in the editor gutter.
- General issues: OpenHelp >Report Issue, selectVS Code Extension, and chooseGitHub Copilot Chat.
When reporting issues, include relevant information from theCopilot logs to help diagnose the problem.