Skip to content

fix(list): leave CI blank when the forge CLI isn't logged in - #4449

Merged
max-sixty merged 1 commit into
mainfrom
nightly/clean-xdg-config-dirs-absolute
Oct 12, 2026
Merged

max-sixty merged 1 commit into
mainfrom
nightly/clean-xdg-config-dirs-absolute

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

Since #4436, any failed forge call shows ⚠. That includes a CLI that is installed but not logged in, which then puts a permanent ⚠ in wt list --full, the shell prompt, and the Claude Code statusline. This change leaves the cell blank when the CLI holds no login for the forge's host, and keeps ⚠ for a failure from a CLI that does (offline, rate limit, expired token).

Each CLI answers from its own local state, so a lost connection never reads as logged out:

  • GitHub: gh exits with its documented code 4 when it has no login for the host it resolved for the request. The backend reads that exit code, so SSH host aliases resolve the way gh resolves them.
  • GitLab / Gitea / Azure DevOps: after a failed call, remote_ref::is_authed_for(forge, host) asks glab config get token --host, tea logins list --output json, or az account show, for the forge.hostname if configured, else the remote's host. The answer is cached per forge and host for the process.

wt config show --full uses the same check for the repo's host and names that host in its warning. It replaces CiToolsStatus, which probed all four CLIs to report one, and asked gh auth status / glab auth status, which contact the server and accept a login for any host. tea's host-agnostic has_any_login is gone with it.

Behavior changes:

  • wt list --full / statusline: a CLI with no login for the host leaves the CI cell blank instead of ⚠. The legend now lists that under blank, and ⚠'s examples say "expired login".
  • wt config show --full: a login for another host no longer counts, and the warning says which host it checked (gh installed but not authenticated for github.com).

Known limits: a GitLab or Gitea remote through an SSH host alias is checked under the alias, so a failure there shows blank unless forge.hostname names the real host; Azure DevOps counts only an az login, not a PAT from az devops login.

Tests: the failed-list test now covers logged-in and logged-out cases for gh (exit 1 vs 4) and glab (token vs none); the tea CI mocks hold a login for the test host; the tea login-discovery test adds a login for another host.

Follows #4436.

This was written by Claude Code on behalf of max-sixty

A failed forge call shows ⚠ only when the CLI holds a login for the
forge's host; without one the cell stays blank, so an installed but
logged-out CLI no longer puts a permanent ⚠ in the prompt and statusline.

gh reports a missing login with exit code 4 for the host it resolved.
For glab, tea and az, remote_ref::is_authed_for asks the CLI's local
state for the forge.hostname or remote host, cached per process.
wt config show uses the same check, names the host in its warning, and
drops CiToolsStatus with its network auth-status probes.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@max-sixty
max-sixty merged commit f98bd11 into main Oct 12, 2026
38 checks passed
@max-sixty
max-sixty deleted the nightly/clean-xdg-config-dirs-absolute branch October 12, 2026 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants