You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
GitHub App sign-in fails to refresh (incorrect_client_credentials) and T3 silently uses the personal login for everything #39032
On one environment (macOS desktop, T3 Code Nightly), the saved GitHub App sign-in can no longer be refreshed, and T3 silently sends every GitHub request with the user's personal gh credential instead. Nothing in the UI says the app sign-in is broken.
What was observed
From that environment's server trace, 62 minutes on 2026-11-19 (07:19 to 08:21 UTC):
About 1,030 GitHubAppSignIn.token / GitHubRest.appCredential spans, every one failing with GitHubAppSessionError. The cause in the span: GitHub did not refresh the sign-in (incorrect_client_credentials).
A sign-in is saved for github.com in settings, with its secret present, so the user did sign in at some point.
All 710 GraphQL and 213 REST requests in that hour carried a credential with a 5,000 limit (the personal login). None used the app's allowance (10,000 GraphQL, 15,000 REST).
When the personal GraphQL allowance reached 5,000 of 5,000 at 07:58 UTC (most of it used by other tools on the same login), getPullRequestDetail failed 3 times, getPullRequestActivity twice and listPullRequests once with GitHubApiRateLimitError, and 32 more requests were refused by T3's own pause. The client showed "Couldn't load this pull request. Pull request operation detail failed: GitHub API rate limit exceeded."
Another environment of the same user, signed in to the same account, refreshes its app token without trouble, so this is not the account or the installation.
Expected
Find out why the refresh is rejected with incorrect_client_credentials on this build. Likely places: the client id or secret the Nightly desktop build uses for the refresh call, or a sign-in made with one app (stable or nightly) being refreshed with the other's credentials.
A sign-in that cannot be refreshed is shown as broken where the user manages GitHub sign-in, with a way to sign in again. It must not look signed in.
Do not retry a refresh that GitHub rejected for the client's credentials on every request: that was about 1,000 failed attempts in an hour.
Related
#39023 covers the other half: what T3 does when the personal credential is rate limited while the app still has allowance. Six of the 32 paused requests here were REST calls blocked by a pause that came from the GraphQL allowance, while REST still had about 2,000 requests left.
Why settings still shows "Signed in with T3 Code for GitHub" with a green check while this is happening, from packages/source-control-github/src/server/GitHubAppSignIn.ts:
refresh clears the saved session only when GitHub answers bad_refresh_token. Any other refusal, incorrect_client_credentials included, raises GitHubAppSessionError and leaves the session saved.
token then fails for every request once the access token has expired, and the request policy falls back to the personal credential.
Settings reports the sign-in from the saved session, so it keeps saying signed in.
The refresh call sends client_id, grant_type=refresh_token and refresh_token, with no client secret. incorrect_client_credentials therefore points at the client_id this build sends not being the one the session was issued to (for example a session made by one of the stable, nightly or development apps and refreshed by another), or at a session that was not issued through the device flow. Worth checking which client id the macOS Nightly desktop build carries against the one the saved session came from.
Activity
juliusmarminge commentedon Nov 19, 2026
Why settings still shows "Signed in with T3 Code for GitHub" with a green check while this is happening, from
packages/source-control-github/src/server/GitHubAppSignIn.ts:refreshclears the saved session only when GitHub answersbad_refresh_token. Any other refusal,incorrect_client_credentialsincluded, raisesGitHubAppSessionErrorand leaves the session saved.tokenthen fails for every request once the access token has expired, and the request policy falls back to the personal credential.The refresh call sends
client_id,grant_type=refresh_tokenandrefresh_token, with no client secret.incorrect_client_credentialstherefore points at theclient_idthis build sends not being the one the session was issued to (for example a session made by one of the stable, nightly or development apps and refreshed by another), or at a session that was not issued through the device flow. Worth checking which client id the macOS Nightly desktop build carries against the one the saved session came from.