Skip to content

Windows: Tower dashboard can't fetch PRs (gh CLI unavailable due to keyring isolation) #2011

Backlog

Description

@OdyAsh

Tower Dashboard Can't Fetch PRs (gh CLI Unavailable)

Context

The Tower dashboard has a "Needs Attention" section that shows open PRs for the project. It fetches these using the gh CLI (GitHub CLI). On Windows, the Tower process can't access the gh CLI's stored credentials, so it shows "gh CLI unavailable — could not fetch PRs" even though gh is authenticated at the Windows level.

This means the dashboard's PR overview is broken on Windows — you can't see open PRs, PR status, or PR activity from the Tower UI.

Environment

  • OS: Windows 11 (build 22631)
  • Node: v22.23.3
  • codev: 3.3.8
  • Tower: v3.3.8
  • gh CLI: authenticated via Windows Credential Manager (keyring)

Steps to Reproduce

  1. Authenticate gh CLI on Windows:

    gh auth login
    # Follow prompts, authenticate with GitHub
    gh auth status
    # ✓ Logged in to github.com account <username> (keyring)
  2. Start the Tower:

    afx tower start
    afx workspace start
  3. Open the Tower dashboard: http://localhost:4100

  4. Go to the "Work" tab

  5. Observe the "Needs Attention" section:

    ### Needs Attention
    gh CLI unavailable — could not fetch PRs
    

Expected Behavior

The dashboard should fetch and display open PRs for the project, showing PR numbers, titles, authors, and status.

Actual Behavior

The dashboard shows "gh CLI unavailable — could not fetch PRs" even though gh auth status works from the terminal:

$ gh auth status
github.com
  ✓ Logged in to github.com account OdyAsh (keyring)
  - Active account: true
  - Git operations protocol: https
  - Token: gho_************************************
  - Token scopes: 'gist', 'project', 'read:org', 'repo', 'user', 'workflow'

The Tower process (PID 65244) was started from a shell that had gh auth, but the dashboard's gh calls fail.

Root Cause

On Windows, gh stores credentials in the Windows Credential Manager (keyring), not in a plain text file. The Tower process runs gh as a subprocess, but the subprocess can't access the keyring because:

  1. Keyring access requires the same user session — the Tower process may be running in a different session context
  2. Windows Credential Manager is per-user, per-session — a process started from a different session can't read the stored credentials
  3. On Linux/Mac, gh stores credentials in ~/.config/gh/hosts.yml (a file any process can read), so this isn't an issue

The Tower log doesn't show the specific gh error, but the dashboard catches the failure and displays "gh CLI unavailable."

Possible Fix

Option A: Use a gh token file instead of keyring

Configure gh to use a token file that the Tower process can read:

# Create a token file
gh auth token > C:\Users\<user>\.gh-token

# Set GH_TOKEN env var for the Tower
$env:GH_TOKEN = Get-Content C:\Users\<user>\.gh-token
afx tower start

Option B: Start Tower from the same session as gh auth

Ensure the Tower is started from a PowerShell session that has already run gh auth login:

gh auth login  # Authenticate in this session
afx tower start  # Start Tower in the same session

Option C: Pass gh token to Tower via env var

Modify the Tower to accept a GH_TOKEN environment variable and pass it to gh subprocesses.

Evidence

gh auth works from terminal

$ gh auth status
github.com
  ✓ Logged in to github.com account OdyAsh (keyring)

Tower dashboard shows unavailable

### Needs Attention
gh CLI unavailable — could not fetch PRs

Tower log (no specific gh error)

[INFO] Tower ready — serving API requests
[WARN] 401 GET /api/workspace/.../prs — missing or invalid key

(The 401 is for the Tower API, not gh — the gh failure is caught silently.)

Impact

  • PR overview broken in Tower UI — can't see open PRs from the dashboard
  • No PR status tracking — can't see which PRs need attention
  • Workaround: Use gh pr list from the terminal instead

Related

  • Finding Add support for GPT5 Codex #23 in the Windows findings artifact
  • No existing open issue found for this specific symptom
  • Related to Windows keyring + process session isolation

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions