Fixing Empty Copilot Model List in VS Code Remote SSH (macOS Host)
When using VS Code Remote SSH to connect to a remote Mac, the GitHub Copilot model selection dropdown was completely empty — I couldn’t switch between GPT-4o, Claude 3.5 Sonnet, or any other models. I first assumed it was a proxy configuration issue and spent a while tweaking settings.json in VS Code, which didn’t work at all. The fix was to disable Node.js SSL verification on the remote Mac via a shell environment variable.
1. Environment and Problem Description
1.1 Basic Setup
- Client: Windows 11, VS Code Insiders
- Remote Host: macOS (Apple Silicon), accessed via SSH
- Network: Local network with AdGuard Home for DNS filtering
- Extension: GitHub Copilot Chat (Pre-release version)
1.2 The Problem
When I opened Copilot Chat and clicked the model selection dropdown, it was completely empty — none of the usual entries (GPT-4o, Claude 3.5 Sonnet, o1-preview, etc.) showed up, just a blank dropdown.
2. Troubleshooting: From DNS to SSL
2.1 Check the Diagnostic Logs
I went straight to VS Code’s built-in diagnostic tool instead of guessing. In the Command Palette (Cmd+Shift+P / Ctrl+Shift+P), I ran:
GitHub Copilot Chat: Diagnostics
The output logs showed two types of errors:
Error 1: SSL/TLS Certificate Issue
Error: unable to get issuer certificate
The Node.js process running Copilot on the remote Mac didn’t trust the SSL certificate chain. The underlying cause was never confirmed. This kind of error is common in corporate networks or when local network tools (like transparent proxies) interfere with HTTPS traffic; AdGuard Home was running on my router, but I never verified that it was involved.
Error 2: Connection Refused
Error: connect ECONNREFUSED 0.0.0.0:443
This error was specific to Microsoft telemetry domains like mobile.events.data.microsoft.com.
2.2 Dealing with DNS Blocking (AdGuard)
The ECONNREFUSED 0.0.0.0 error was caused by AdGuard Home blocking Microsoft’s telemetry domains. I initially thought this was the main issue, so I added these domains to AdGuard’s allowlist:
@@||github.com^
@@||api.github.com^
@@||githubcopilot.com^
After that, the ECONNREFUSED errors disappeared — but the model list was still empty. DNS blocking was only a secondary issue; the real problem was the SSL certificate error.
2.3 Trying to Fix It via VS Code Settings (Failed)
{
"http.proxyStrictSSL": false,
"remote.SSH.serverEnv": {
"NODE_TLS_REJECT_UNAUTHORIZED": "0"
}
}
I saved the file and reconnected to the remote host.
Result: Didn’t work at all.
In Remote SSH scenarios (especially connecting to macOS), environment variables set in VS Code’s settings.json often fail to propagate correctly to the extension host process, because of shell loading order:
- Interactive shells read
.zshrc/.bashrc - Login shells read
.zprofile/.bash_profile - When VS Code Server starts extensions, it might use one of these paths, and the environment variables from
settings.jsonsimply don’t make it through
3. The Fix: Modify the Remote Shell Configuration Directly
Since settings.json didn’t work, I wrote the environment variable directly into the remote Mac’s shell configuration files.
3.1 Modify the Remote Host’s Shell Config
On the remote macOS machine, I added the environment variable to both .zshrc and .zprofile, so it would be set regardless of which shell startup method VS Code Server uses:
echo 'export NODE_TLS_REJECT_UNAUTHORIZED=0' >> ~/.zshrc
echo 'export NODE_TLS_REJECT_UNAUTHORIZED=0' >> ~/.zprofile
source ~/.zshrc
Verify it worked:
echo $NODE_TLS_REJECT_UNAUTHORIZED
This should output 0.
3.2 Force Copilot to Use Node.js Fetcher
In the local VS Code settings.json, I also added these two lines to force Copilot to use the Node.js fetch implementation (instead of Electron’s), since the Node.js fetcher responds more reliably to environment variables:
{
"github.copilot.advanced.debug.useNodeFetcher": true,
"github.copilot.advanced.debug.useElectronFetcher": false
}
3.3 Completely Restart the Remote Server
This step is easy to overlook: don’t just do Developer: Reload Window, because the VS Code Server process might still be running in the background with the old environment variables.
- Open the Command Palette (
Cmd+Shift+P/Ctrl+Shift+P) - Run Remote-SSH: Kill VS Code Server on Host…
- Select the remote host’s IP/hostname
- Reconnect to the remote host
After doing this, the Copilot model list immediately appeared, all models were selectable, and Chat functionality was restored.
One caveat: NODE_TLS_REJECT_UNAUTHORIZED=0 makes every Node.js process that reads this environment variable skip TLS certificate verification. I did use it to get through this troubleshooting session, but the long-term fix is to repair the CA certificate chain so that verification stays on.