[BUG] Desktop: GitLab MR bound to a session shows "GitHub CLI authentication expired" because GitHub-only PR code queries gh for the gitlab.com host

Status Fixed / completed
Maintainer reply None cached
Activity 0 comments · opened Sep 23, 2026 · closed Sep 24, 2026

What's Wrong?

A GitLab merge request bound to a desktop Code session shows a warning icon with the tooltip:

GitHub CLI authentication expired. Run gh auth login to refresh pull request status.

Both CLIs are authenticated and working:

  • gh auth status: logged in to github.com (keyring), token valid. gh has no other hosts, and it can't have gitlab.com, since it's GitHub-only.
  • glab auth status: logged in to gitlab.com (keyring). glab config get token --host gitlab.com returns the token, so the app's own glab host check passes.

The MR row itself is correct: number, state (open/closed) and branch come through the glab path (glab api --hostname gitlab.com ...). Only the open MR has the warning; the closed one doesn't.

main.log repeats this line about every 30 seconds while the session is focused:

[warn] [GhRestClient] Refusing auth for an unconfigured host

So a GitHub-only code path is still asking GhRestClient for credentials for gitlab.com, and the resulting "unauthenticated" failure kind is shown as expired gh credentials. From the shipped bundle, several GitHubPrManager paths take a host but don't check the binding's provider, so they're candidates: the /user login lookup (getGhLogin), PR checks, and the branch-based PR lookup (/repos/{owner}/{name}/pulls?head=...). I couldn't tell which one fires from info-level logs.

Running gh auth login can't fix this, and the message sends users down the wrong path. They start re-logging gh or glab and suspect their git credential setup.

What Should Happen?

PR bindings with provider: "gitlab" should never be routed through GhRestClient/gh, and the "GitHub CLI authentication expired" warning should never be shown for a non-GitHub host.

Steps to Reproduce

  1. Have gh logged in to github.com only, and glab logged in to gitlab.com.
  2. In a desktop Code session working in a repo whose remote is on gitlab.com, open an MR and bind it to the session. The session JSON stores it as {"provider": "gitlab", "host": "gitlab.com", "state": "OPEN", ...}.
  3. Focus that session.
  4. The MR row renders with the correct state, plus a warning icon: "GitHub CLI authentication expired. Run gh auth login to refresh pull request status."
  5. ~/Library/Logs/Claude/main.log shows [GhRestClient] Refusing auth for an unconfigured host about every 30 s while the session stays focused.

Environment

  • Claude desktop app 2.7032.0 (macOS, Apple Silicon)
  • macOS 26.7
  • gh 2.101.0 (github.com only, keyring)
  • glab 1.119.0 (gitlab.com, keyring)
  • Git credential helper: default osxkeychain; remote is plain https://gitlab.com/<group>/<subgroup>/<project>.git (nested group)

Related

  • #67087, #80134: same banner with valid github.com credentials (different cause)
  • #67055: gh failures misclassified as expired auth
  • #84214: never-authenticated gh reported as expired

View original on GitHub ↗