The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 24, 15:15 UTC
fix(server): outdated gh no longer reads as "not authenticated" (#7588)
Theo Browne committed
Aug 19, 2026 at 16:35 UTC
51341f2ac1e25032efac13ef6e9652e9c74b48a3
4 files changed
+29
-2
apps/server/src/sourceControl/GitHubSourceControlProvider.test.ts
+15
@@ -381,3 +381,18 @@ it("reports unauthenticated when GitHub JSON has accounts but none are valid", (
381
},
382
);
383
});
384
+
385
+it("reports an update hint instead of unauthenticated when gh predates --json", () => {
386
+ const auth = GitHubSourceControlProvider.discovery.parseAuth(
387
+ processResult("", {
388
+ stderr: "unknown flag: --json\n\nUsage: gh auth status [flags]\n",
389
+ exitCode: ChildProcessSpawner.ExitCode(1),
390
+ }),
391
+ );
392
+
393
+ assert.strictEqual(auth.status, "unknown");
394
+ assert.match(
395
+ Option.getOrElse(auth.detail, () => ""),
396
+ /2\.81\.0/,
397
+ );
398
+});
apps/server/src/sourceControl/GitHubSourceControlProvider.ts
+10
@@ -67,6 +67,16 @@ function parseGitHubAuth(input: SourceControlAuthProbeInput) {
67
});
68
}
69
70
+ // gh gained `auth status --json` in 2.81.0. Older versions reject the flag and exit
71
+ // non-zero, which reads exactly like a signed-out CLI. Name the real problem instead.
72
+ if (input.exitCode !== 0 && output.includes("unknown flag: --json")) {
73
+ return providerAuth({
74
+ status: "unknown",
75
+ detail:
76
+ "GitHub CLI is too old to report sign-in status. Update `gh` to 2.81.0 or newer (for example `brew upgrade gh`) and rescan.",
77
+ });
78
+ }
79
+
80
if (input.exitCode !== 0) {
81
return providerAuth({
82
status: "unauthenticated",
apps/web/src/components/settings/SourceControlSettings.tsx
+2
-1
@@ -240,9 +240,10 @@ function itemSummary({
240
</span>
241
);
242
}
243
+ const authDetail = optionLabel(auth.detail);
244
return (
245
<span>
245
- Could not verify {item.label}. {item.installHint}
246
+ Could not verify {item.label}. {authDetail ?? item.installHint}
247
</span>
248
);
249
}
docs/user/source-control.md
+2
-1
@@ -67,7 +67,7 @@ Run a quick **Rescan** after setting up a new machine or changing credentials.
67
68
### For GitHub (Recommended for most users)
69
70
-1. Install the GitHub CLI on the machine running T3 Code:
70
+1. Install the GitHub CLI (version 2.81.0 or newer) on the machine running T3 Code:
71
```bash
72
brew install gh
73
```
@@ -140,6 +140,7 @@ Control settings**.
140
**Common issues:**
141
142
- **Provider shows "Not authenticated"** – Run the login command for that provider (e.g., `gh auth login`) in a terminal on the server, then rescan in Settings
143
+- **GitHub says it could not verify sign-in status** – T3 Code needs GitHub CLI 2.81.0 or newer to check sign-in status. Update `gh` (e.g., `brew upgrade gh`), then rescan
144
- **Bitbucket not connecting** – Double-check your environment variables are set in the correct shell profile and the server was restarted
145
- **Can't push to a remote** – Verify your Git remote URL matches the provider you've authenticated with (SSH vs HTTPS remotes may need different credentials)
146