Repository navigation
feat(status): show logged-in GitHub user + Copilot plan on the status card - #56
Merged
Merged
Conversation
… card
The GitHub line on the status card now folds in who's logged in and their
Copilot subscription tier, e.g.:
GitHub login ✓ connected · Can Wang (canwa_microsoft) · Copilot Enterprise
- src/providers/copilot/account.ts: fetchGithubUser() (GitHub /user →
login+name, best-effort/timed-out), skuLabel() (sku → friendly plan name),
formatIdentity() ("Name (login)").
- token.ts: CopilotTokenStore now parses the entitlement (sku/chat_enabled/
individual) that already rides along on the token exchange and exposes it
via getEntitlement() — no extra network call for the plan.
- status-summary.ts: StatusInputs/StatusSummary carry optional identity+plan;
summarizeStatus only surfaces them when actually connected (no stale name on
an expired/signed-out token).
- app.tsx: statusCard() appends identity + plan to the GitHub line when
present; new accountInfo() prop feeds the live /status card.
- cli/index.ts: resolves account (username cached per-login, cleared on
/login re-auth; plan from the cached entitlement) for startup + /status.
All best-effort — a failed/pending lookup omits the segments cleanly.
Verified live against real Copilot creds: renders
"✓ connected · Can Wang (canwa_microsoft) · Copilot Enterprise".
Full suite green (675); tsc clean.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…d-identity # Conflicts: # src/tui/app.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The status card's GitHub line now shows who's logged in and their Copilot subscription tier:
Answers both parts of the request: the username on the login status, and Copilot subscription status.
How
GET https://api.github.com/user→login+name, formatted asName (login). Best-effort and timed out; a failure just omits it./copilot_internal/v2/token) already returns askufield (e.g.copilot_enterprise_seat_quota) pluschat_enabled.CopilotTokenStorenow parses that entitlement and exposes it viagetEntitlement()— no extra network call; the plan rides along on a request we already make.skuLabel()maps the sku to a friendly name (Enterprise / Business / Pro / Free), with a legible fallback for unknown skus.Both are best-effort and connection-gated:
summarizeStatusonly surfaces identity/plan when the token is actually valid, so an expired or signed-out login never shows a stale name.Files
src/providers/copilot/account.tsfetchGithubUser,skuLabel,formatIdentity(new)src/providers/copilot/token.tssrc/tui/status-summary.tsidentity/planon inputs+summary, gated on connectedsrc/tui/app.tsxstatusCard()folds them into the GitHub line; newaccountInfoprop for live/statussrc/cli/index.ts/status(username cached per-login, cleared on/loginre-auth)Tests
account.test.ts— user fetch (success / no-name / non-ok / reject / timeout / headers),skuLabelfamilies + fallback,formatIdentityvariants.token.test.ts— entitlement parsed from the exchange with no extra call; undefined when sku absent.status-summary.test.ts— identity/plan pass through when connected, omitted when expired/signed-out.app-interaction.test.tsx— startup card folds username+plan into the GitHub line;/statuspulls fresh values viaaccountInfo.Full suite green: 675 tests / 75 files.
tscclean.Verified live against real Copilot creds — renders
✓ connected · Can Wang (canwa_microsoft) · Copilot Enterprise(skucopilot_enterprise_seat_quota→ "Copilot Enterprise").e2e scope
No proxy request/response surface — this reads two account endpoints and renders a TUI card. The http-e2e / cli-e2e matrices don't apply; unit + real-
<App>interaction coverage is the gate.Changeset: minor.