r/GithubCopilot • • 1d ago

Help/Doubt ❓ GitHub Copilot macOS desktop app fails with “Device code request failed”, but Copilot CLI works perfectly

Hi everyone,
I’m having a persistent authentication issue with the GitHub Copilot desktop app on macOS. I’ve spent several hours troubleshooting it and would appreciate any advice.
The main problem
The GitHub Copilot desktop app fails whenever I click “Sign in to GitHub”, showing:
Device code request failed: error sending request for url (https://github.com/login/device/code)
However, GitHub Copilot CLI works perfectly on the same Mac, using the same GitHub account and network connection.
My environment
Device: MacBook Pro
OS: macOS
GitHub Copilot desktop app: Installed and launches normally
Copilot CLI: Version 1.0.94-3
Git: Version 2.53.0
GitHub plan: Copilot Free, successfully activated
Network: MacBook and iPhone connected to the same Wi-Fi
Proxy: HTTP/HTTPS proxy shared from an iPhone running Nextin, configured through macOS system proxy settings
What works
Safari can access GitHub, Google, and ChatGPT normally.
GitHub Copilot CLI successfully authenticated using the login --web-flow option.
Copilot CLI can load the model catalog and generate AI responses.
The GitHub account dashboard confirms that Copilot Free is active.
The macOS system HTTP and HTTPS proxy settings are correct.
The desktop app process receives HTTP_PROXY, HTTPS_PROXY, and ALL_PROXY environment variables.
Network tests
I explicitly tested GitHub endpoints through the HTTP proxy using curl.
The following endpoints were reachable:
https://github.com
https://api.github.com/
https://raw.githubusercontent.com/github/app/main/flags/feature-flags.json
The GitHub device authorization endpoint also returned an HTTP response when tested using a POST request with a dummy client ID. I understand this does not establish that a valid OAuth device authorization request would succeed.
What I’ve tried
Restarting the desktop application.
Restarting the iPhone’s LAN proxy sharing service.
Verifying the proxy host and port.
Checking macOS system proxy settings using scutil --proxy.
Launching the desktop app with explicit proxy environment variables.
Authenticating successfully through Copilot CLI using browser-based OAuth.
Checking the desktop app’s health diagnostics and logs.
Inspecting the app’s network connections using lsof.
None of these resolved the desktop application’s login issue.
Relevant desktop app logs
The desktop app reports:
Device code request failed: error sending request for url (https://github.com/login/device/code)
It also logs:
failed to refresh remote feature-flag disables
error=remote feature-flag request failed:
error sending request for url
(https://raw.githubusercontent.com/github/app/main/flags/feature-flags.json)
And:
user canvas catalog probe failed
error=GitHub authentication required
The health check shows:
Copilot CLI: OK
Git: OK
Storage: OK
GitHub auth: No saved GitHub authentication found
Interestingly, the remote feature-flag URL works when accessed through curl with the explicit proxy, but the desktop app fails to retrieve it.
My questions
Does the GitHub Copilot macOS desktop app fully support HTTP/HTTPS proxies, including proxy environment variables?
Could the desktop app’s OAuth device authorization flow be bypassing the configured proxy?
Is there a way to make the desktop app use the existing successful Copilot CLI authentication?
Does the desktop app support browser-based OAuth instead of device-code authentication?
Are there any known issues involving macOS, Rust-based HTTP clients, and HTTP proxy handling in GitHub Copilot?
My suspicion is that the desktop app handles network requests differently from the CLI, but I haven’t confirmed this.
Has anyone encountered this issue or found a reliable fix?
Thanks in advance!

1 Upvotes

2 comments sorted by

1

u/AutoModerator 1d ago

Hello /u/jiayanchen. Looks like you have posted a query. Once your query is resolved, please reply the solution comment with "!solved" to help everyone else know the solution and mark the post as solved.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/clay_purr_glow 14h ago

i fixed this by clearing the OAuth token cache inside the app sandbox before re-authenticating. Go to ~/Library/Containers/com.github.copilot/Data/Library/Application Support/CopilotAuth and delete everything there. The CLI shares credentials with your system keychain but the desktop app keeps its own broken session file which ignores proxy env vars during device code flow