Repository navigation
Description
What T3 does
T3 discovers every forge provider up front and reports readiness as data, not as a surprise at the moment you click something. SourceControlDiscovery returns a sourceControlProviders[] with {kind, label, status, installHint, auth: {status, detail}}; Settings -> Source Control renders it as a list of "authenticated and ready / what is missing and how to fix it / which account is signed in", plus a Rescan button (docs/user/source-control.md).
That data then gates the UI. buildAddProjectRemoteSourceReadiness (packages/client-runtime/src/operations/projects.ts:127) turns discovery into Record<source, {ready, hint}>: a provider that is missing renders with its install hint, an unauthenticated one renders with the login hint, and sortAddProjectProviderSources floats the ready ones to the top of the Add Project source list. GitHub carries a real version gate too — status checks need gh >= 2.81.0, and the failure message says so instead of saying "auth failed".
Solenta today
There is no forge probe. The only thing resembling one is a regex over command output after a failure (electron/worktrees.js:1781):
/gh auth login|GH_TOKEN|not logged into|authentication required|HTTP 401|Bad credentials/iSo we learn gh is missing or logged out only after a push, a PR create, or a planboard sync has already failed, and the user has to interpret raw stderr. There is no place in the app that answers "is my GitHub set up, and as whom".
Why it matters
Every forge feature we have or plan (#459 clone/publish, #456 Bitbucket + Azure DevOps, #193 GitLab, #363 commit-push-PR chain, #427 outage resilience, planboard sync) needs the same answer: is this provider installed, new enough, authenticated, and as which account. Without it each feature grows its own ad-hoc failure text. It is also the honest fix for first-run: #356 preflights the agent CLIs but nothing preflights gh.
This is the forge-side twin of #319 (provider auth detection against reality, not config presence) — same principle, different binary.
Scope suggestion
- One
sourceControl:discoverIPC that probes each configured forge CLI: present? version?gh auth status/glab auth status/az account show? which login? Cache with an explicit Rescan. - Settings pane listing providers with status, account, and a copy-pasteable fix command.
- Feed the result into the add-project source list (Clone from URL and publish a local repo in add-project #459) and disable/annotate forge actions instead of failing at click time.
- Keep the existing stderr regex as a fallback for auth that expires mid-session, and invalidate the cache when it fires.
Activity
currentbits commentedon Aug 20, 2026
Implemented in this worktree (
coder/fork-source-control-settings-probe-forge-bc94fa):sourceControl:discoverIPC probes GitHub (gh), GitLab (glab), Azure DevOps (az+azure-devopsextension), and Bitbucket env tokens. Cached until Rescan or a mid-sessionisGhAuthFailurehit.src/sourceControl.tsexportsbuildAddProjectRemoteSourceReadiness/sortAddProjectProviderSourcesfor Clone from URL and publish a local repo in add-project #459. Add Project itself is unchanged (clone source list is still that issue).GitHub 2.81.0 is the JSON
gh auth statusgate only. An older gh that still printsLogged in to … account NAMEstays available so we do not lie about Create PR.currentbits commentedon Aug 20, 2026
Landed on main (d5fd524 + c933916).
electron/sourceControl.js: probes gh / glab / az up front (gh auth status --json hostson 2.81+, text parse below that, "outdated" only when a sub-2.81 gh can't report sign-in), Bitbucket viaSOLENTA_BITBUCKET_*env tokens. Cached until Rescan or anisGhAuthFailurehit busts it.sourceControl:discoverIPC → Settings → Source Control section (status dot, version, signed-in-as, copy-pasteable hint, Rescan).Tests:
electron/test/source-control.test.js(7) +test/sourceControl.test.ts,test/sourceControlSettings.test.tsx, next-git additions. Full renderer suite green (1333).