Skip to content

GitHub source control shows "Not authenticated" when gh is outdated (missing auth status --json) #3806

Description

@Noisemaker111

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/server

Steps to reproduce

  1. Install gh older than 2.81.0 (e.g. 2.74.2) on the machine running T3 Code.
  2. Run gh auth login, and confirm gh auth status shows you logged in.
  3. Open Settings → Source Control, then click Rescan.

Expected behavior

GitHub is reported as authenticated, since gh auth status confirms the user is signed in.

Actual behavior

GitHub shows "Not authenticated" and Rescan never clears it, even though the user is fully signed in. Because the message tells you to sign in, users run gh auth login over and over — which never helps, since the real problem is the CLI version, not the login.

Root cause: the server detects auth by running gh auth status --json hosts and parsing the JSON:

  • apps/server/src/sourceControl/GitHubSourceControlProvider.ts:91authArgs: ["auth", "status", "--json", "hosts"]
  • The --json flag was only added to gh auth status in gh v2.81.0 (Add JSON output to gh auth status cli/cli#11544, merged 2025-09-25).

On older gh, the command fails with unknown flag: --json (exit 1), so parseGitHubAuthStatus returns { parsed: false }, and parseGitHubAuth falls into the exitCode !== 0 branch (GitHubSourceControlProvider.ts:70) → "unauthenticated". gh --version is never consulted, and the raw error is hidden behind a generic badge — so the UI conflates "your CLI is too old" with "you're logged out," which have opposite fixes.

Impact

Major degradation or frequent failure

Version or commit

Environment

gh 2.74.2 (reproduces on any gh < 2.81.0).

Logs or stack traces

$ gh auth status --json hosts
unknown flag: --json

Screenshots, recordings, or supporting files

Before / after:

Image

Workaround

Upgrade gh to v2.81.0 or newer.


Proposed fix (implemented in a draft PR): distinguish an outdated source-control auth status from unauthenticated — when gh rejects --json (or the parsed gh --version is < 2.81.0), report outdated with an "Outdated CLI" badge instead of "Not authenticated".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions