Skip to content

github plugin latches needs-configuration on one transient gh auth failure and never re-probes #1758

Description

@MGrin

Summary

The builtin github plugin probes gh auth status exactly once, at load. On any failure it enters needs-configuration and stays there for the life of the server process — nothing re-probes. A single transient failure at bb start therefore disables the plugin indefinitely on a machine where gh works perfectly, and the message it shows names a remedy that cannot fix it.

Observed on bb 0.38.0, macOS 26 (Darwin 25.5.0), gh 2.95.0.

What happened

The plugin sat in needs-configuration for over a day:

$ bb plugin list
[email protected]  needs-configuration  (GitHub CLI is not authenticated. Install the
GitHub CLI (https://cli.github.com) and run `gh auth login`, then
`bb plugin reload github`.)

while gh was authenticated and in active use the whole time (gh pr create, gh pr merge, gh api, gh run view):

$ gh auth status
github.com
  ✓ Logged in to github.com account MGrin (keyring)
  - Active account: true
  - Token scopes: 'gist', 'read:org', 'read:packages', 'repo', 'workflow'

bb plugin reload github fixed it instantly. Nothing about the machine had changed in between.

Cause

From the shipped server/dist/builtin-plugins/github/dist/server.js:

async function checkAuth() {
  try {
    await gh(["auth", "status"], 1e4);
    ghAuthError = null;
  } catch (error) {
    ghAuthError = error instanceof Error ? error.message : String(error);
    throw needsConfiguration(`GitHub CLI is not authenticated. ${GH_HINT}`);
  }
}

checkAuth() runs at plugin load and only runs again on reload. Any one-off failure is latched permanently.

gh auth status is not a local-only check — it makes a real API call. Measured on this machine: 773 ms idle, 0.8–1.5 s at load average 23. So plausible one-off causes at startup include a login keychain not yet unlocked (the token is in the macOS keyring, not hosts.yml), a network blip, a slow start pushing past the 10 s timeout, or bb simply starting before gh auth login was ever run.

I could not determine which of those occurred in my case — the plugin keeps ghAuthError internally but bb plugin list shows only the generic hint, so the original error is not recoverable after the fact. That is arguably a second, smaller issue.

The message points at the wrong remedy

The hint says to run gh auth login. In this failure mode gh is already authenticated, so that changes nothing; the fix is the reload. Following the on-screen instruction produces no improvement, which reads as "bb is broken".

Reproduction

  1. Make gh auth status fail transiently at bb start — e.g. start bb with the network down, or before running gh auth login.
  2. Restore gh to a working authenticated state and confirm with gh auth status.
  3. bb plugin list — github is still needs-configuration, indefinitely.
  4. bb plugin reload github — it comes back as running.

Suggested fixes, any of which would do

  • Re-probe on demand (or on a modest interval / backoff) instead of latching a terminal state — a transient dependency failure is not a configuration error.
  • Distinguish "probe failed" from "gh reported unauthenticated", and word the hint accordingly. Only the second one should say gh auth login.
  • Surface the retained ghAuthError in bb plugin list so the original cause is diagnosable after the fact.

Workaround

For anyone hitting this: bb plugin reload github. gh auth login is not the fix if gh auth status already succeeds.

Activity

  1. added theissue type on Aug 18, 2026
  2. added
    github
    on Aug 18, 2026
  3. SawyerHood commented on Aug 18, 2026

    @SawyerHood
    Collaborator

    Reproduction & root-cause report: https://get-bb.github.io/reports/issues/1758.html

    • Verdict: REPRODUCED · root-cause confidence: high
    • Root cause (short): plugins/github/server.ts checkAuth() maps every gh auth status failure (a network probe: outage, locked keychain, 10 s timeout) to NeedsConfigurationError, which the load-time probe reports via bb.status.needsConfiguration and the sync service throws out of start(); the plugin runtime then stops the service "until reload" and keeps needs-configuration until the next load, the plugin API has no way to clear it, and the app skips the frontend bundle of non-running plugins, so nothing ever re-runs gh and the "run gh auth login" hint cannot help.
    • Proposed fix: Plugin-only change in plugins/github/server.ts (prototype diff at /tmp/bb-reports/issues/1758/repro/proposed-fix.diff, applied in the worktree; makes the 4-test repro file pass and keeps bb-plugin-github typecheck/tests green): (1) checkAuth() throws NeedsConfigurationError only when gh is missing or holds no credentials at all, using the network-free gh auth token to tell "not logged in" from "logged in but the API probe failed"; other failures become a plain Error carrying gh's stderr. (2) The sync service catches non-configuration errors inside its loop and retries with backoff (30 s doub…
    • Caveats: Reproduced on Linux with gh 2.96.0 (issue reports macOS 26 / gh 2.95.0 / bb 0.38.0); the macOS locked-keychain trigger is unverified here but takes the identical code path (any non-zero exit of gh auth status). Live repro used a shim that runs the real gh through a dead proxy (HTTPS_PROXY to a closed port) to simulate the network outage; the first live attempt was confounded by the dev server ho…

    The report has copy-paste repro steps, screenshots where the bug is visual, code permalinks at 16ceb3a54, and repro artifacts. It was independently re-run by a second agent (see its Verification section).

    AGENT GENERATED: by Claude Opus 5

  4. added
    confirmed-repro
    on Aug 18, 2026
  5. added 2 commits that reference this issue on Aug 18, 2026
    40035f7
    a9dd53f
  6. added 2 commits that reference this issue on Aug 18, 2026
    d3b8b64
    abbc3f9
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

    confirmed-reprogithub

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions