Repository navigation
Description
Short summary
Copilot Desktop writes its private versioned gh.exe into global ~/.gitconfig for *.ghe.com, leaves github.com unconfigured, injects a reduced-scope GH_TOKEN into agent shells, and keeps a separate SAML/SSO token store from gh CLI.
Affected version or release
GitHub Copilot Desktop v1.5.0 (Windows; bundled gh folders observed: copilot-desktop-gh-2.102.0, 2.102.1, 2.103.3)
Installation context
Windows 11 (10.0.26300.0) using GitHub Copilot Desktop with a dual-host setup: Enterprise Managed User / Data Residency host (.ghe.com) for work + github.com personal account, alongside system GitHub CLI (2.102.0) and Git for Windows (2.56.0.windows.2).
What happened?
When using GitHub Copilot Desktop on Windows with a *.ghe.com (Data Residency / EMU) work account alongside a github.com account, four auth and git-credential issues collide:
-
Private versioned gh.exe written into global ~/.gitconfig (and stale versions left behind):
Copilot Desktop configured credential helpers in the user's global ~/.gitconfig pointing to its own private versioned binary path:
%LOCALAPPDATA%\copilot-desktop-Remote MCP tools are not immediately available #2.102.1\gh.exe auth git-credential
It wrote this only for https://.ghe.com and https://gist..ghe.com while leaving https://github.com and https://gist.github.com unconfigured. Across app updates, old versioned folders also accumulate in %LOCALAPPDATA% (copilot-desktop-Remote MCP tools are not immediately available #2.102.0, copilot-desktop-Remote MCP tools are not immediately available #2.102.1, copilot-desktop-Remote MCP tools are not immediately available #2.103.3), leaving ~/.gitconfig pinned to a stale versioned path. -
Host-injected GH_TOKEN overrides the user's gh keyring scopes:
Copilot Desktop injects its own gho_ GH_TOKEN into agent shells. Because that token does not include admin scopes (such as admin:org / admin:enterprise), it shadows the user's already-authenticated system gh keyring login and breaks org/enterprise admin operations until the shell explicitly runs Remove-Item Env:GH_TOKEN. -
Separate SAML/SSO token store from gh CLI:
Copilot Desktop's OAuth token store is independent from gh CLI's OS keyring. When SAML/SSO expires and the app hits 403s, running gh auth refresh succeeds for CLI calls but never resolves app-side SAML/SSO 403s — users have to re-authenticate SAML in the browser and sign out/in of Copilot Desktop separately. -
Dual-host (*.ghe.com + github.com) routing friction:
With a global ~/.gitconfig partially rewritten for *.ghe.com (and github.com unconfigured), plus GH_TOKEN injection, dual-host workflows (enterprise work on *.ghe.com + public github.com reads, skill updates, and issue filing) break or silently fall back to unauthenticated github.com requests that quickly hit the 60/hr shared corporate proxy IP rate limit.
Steps to reproduce
- Install GitHub Copilot Desktop on Windows alongside system Git for Windows and GitHub CLI (gh), authenticated in gh's keyring to both https://.ghe.com (with org/enterprise admin scopes) and https://github.com.
- Sign into Copilot Desktop with the .ghe.com account and use the app across a few app updates.
- Inspect ~/.gitconfig and %LOCALAPPDATA%\copilot-desktop-gh-*:
- ~/.gitconfig points *.ghe.com credential helpers to a pinned %LOCALAPPDATA%\copilot-desktop-gh-\gh.exe path, while github.com has no helper configured.
- Multiple stale copilot-desktop-gh-* directories remain in %LOCALAPPDATA%.
- Inside an agent terminal spawned by Copilot Desktop, run an org/enterprise admin gh api call against .ghe.com:
- Fails due to the host-injected gho_ GH_TOKEN shadowing the keyring token until Remove-Item Env:GH_TOKEN is run.
- Trigger a SAML/SSO session expiry and run gh auth refresh -h .ghe.com:
- System gh CLI works again, while Copilot Desktop continues returning SAML/SSO 403s until signing out/in of the app after browser SSO.
Expected behavior
- Copilot Desktop should not mutate global ~/.gitconfig to point at private versioned %LOCALAPPDATA%\copilot-desktop-gh-\gh.exe paths (or should use a stable shim/scoped config and leave the user's system gh credential setup intact across all configured hosts, including github.com). Old copilot-desktop-gh-* folders should be cleaned up on upgrade.
- Agent shells should either allow opting into the user's system gh keyring auth (see Add possibility to change gh cli authentication to use keyring instead of def... #5083) or avoid injecting a reduced-scope GH_TOKEN that shadows a fuller-scoped keyring login for the same host.
- App-side SAML/SSO 403s should clearly surface that Copilot Desktop has its own OAuth token separate from gh CLI (and offer a one-click re-authorize / refresh flow instead of requiring manual sign-out/sign-in).
- Dual-host setups (*.ghe.com + github.com) should work seamlessly with authenticated system gh CLI without breaking either host or forcing anonymous github.com calls.
When using Antigravity or T3 Code, I have not had "any" issues in terms of this. But using GH CP, I faced daily issues with tokens and access and what have you - to the point of asking the AI agent for help every time without any permanent solution. Worsened by having several computers. It felt as if the GHCP app does not "know" Github.
Additional context
- Workarounds we had to apply locally:
- Ran system "C:\Program Files\GitHub CLI\gh.exe" auth setup-git for both .ghe.com and github.com (restoring all four credential helpers while preserving includeIf for enterprise git identity).
- Kept GH_HOST unset globally so github.com remains the gh default while explicitly passing --hostname .ghe.com for enterprise operations.
- Added Remove-Item Env:GH_TOKEN before enterprise admin gh commands inside Copilot Desktop agent shells.
- With authenticated system gh CLI working cleanly for both hosts, no extra GitHub MCP server is needed.
- Environment:
- OS: Windows 11 (10.0.26300.0)
- GitHub Copilot Desktop: v1.5.0
- System gh CLI: 2.102.0
- System Git: 2.56.0.windows.2
- Leftover local folders: %LOCALAPPDATA%\copilot-desktop-Remote MCP tools are not immediately available #2.102.0, 2.102.1, 2.103.3
- Related open issue: Add possibility to change gh cli authentication to use keyring instead of def... #5083 (option for gh CLI auth to use keyring instead of defaulting to GH_TOKEN).
Activity
github-app-releaser commentedon Nov 25, 2026
Could you narrow this issue to one independently trackable problem and report the others separately: global credential-helper configuration/version cleanup, agent-shell token scope/keyring selection, and app-side SAML/SSO reauthorization? These have separate expected outcomes: fixing the credential-helper path would still leave token-scope and SSO-refresh failures unresolved, so separate issues are needed for independent investigation and tracking. The token/keyring behavior is already described in #5083, including enterprise-admin scope failures; you can continue that part there. Keep related symptoms, reproduction steps, and dual-host effects together with the problem they illustrate—the supplied description and steps do not need additional logs or root-cause proof.