Repository navigation
Description
Before submitting
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area
Build, CI, or release tooling
Steps to reproduce
The issue text below names no accounts or repos of ours. owner/repo and github-work are placeholders.
Remotes that use an SSH host alias (git@github-work:owner/repo.git) are classified as an unknown provider, so PRs never sync and threads never settle on merge
Setup
A common way to use two GitHub accounts on one machine is one SSH key per account, chosen by a host alias in ~/.ssh/[config](https://github.com/Users/dgregory/.ssh/config):
Host github-work
HostName github.com
User git
IdentityFile ~/.ssh/id_github_work
IdentitiesOnly yes
and clones made through the alias: git clone git@github-work:owner/repo.git.
Git, ssh and gh all handle this (gh resolves the alias through ssh -G).
Cause (from reading the 0.0.45 bundle)
pickPrimaryRemotetakesupstream, thenorigin, from the fetch URLs ingit remote -v.detectSourceControlProviderFromRemoteUrlclassifies by the URL's host string.isGitHubHostacceptsgithub.comor a host with agithubDNS label.github-workis a single label, so the result iskind: "unknown"withbaseUrl: https://github-work.refineUnknownProjectKindsthen probes thatbaseUrl.https://github-workdoesn't resolve, so the provider staysunknown, and nothing registered handlesunknown.
Nothing consults ~/.ssh/[config](https://github.com/Users/<username>/.ssh/config). (selectGitHubBaseRepository's comment
already allows for remotes "under an SSH alias", so part of the code is aware of them.)
A dotted alias isn't a way out: github.work would be classified as "GitHub Self-Hosted" with base https://github.work, which gh isn't logged in to.
Suggested fix
For SSH remotes (scp-style user@host:path and ssh://), resolve the host alias before classifying:
ssh -G github-work | awk '$1 == "hostname" { print $2 }' # -> github.com
Then classify and build baseUrl from the resolved hostname, keeping the original remote URL for git operations. ssh -G only reads the config. It opens no connection, so it's cheap and can be cached with the repository identity. Resolving the alias the same way in the clone flow, and cloning over SSH when the user gives an SSH alias, would cover the second symptom.
Expected behavior
Thread would auto-settle when the PR is merged.
Actual behavior
- A thread's linked PR is never synced:
projection_thread_pull_requestskeepssnapshot_jsonNULL, so the thread doesn't settle when the PR merges. boot-service.logrepeats, on every sweep:pull request sync skippedforgithub.com/owner/repo#Nthread branch pull request lookup failed ... No unknown source control provider is registered.
- Related: "new project from GitHub" can't produce such a clone. Its
ghlookup rejects the alias host, and it then clones over HTTPS, which fails on a headless server with no credential helper. Cloning by hand through the alias and adding the folder as an existing project works, apart from the PR sync above.
Impact
Major degradation or frequent failure
Version or commit
0.0.45
Environment
macOS 26.6.2 and ubuntu 26.04.1
Logs or stack traces
Screenshots, recordings, or supporting files
No response
Workaround
Add a second remote named upstream with the plain URL, which pickPrimaryRemote prefers, and keep origin on the alias for git:
git remote add upstream git@github.com:owner/repo.git
git config remote.upstream.skipFetchAll true
git config remote.upstream.pushurl no-push # never push here
After the identity cache refreshed (about 9 minutes, no restart), the PRs synced with "state":"merged".
Activity
roodboi commentedon Oct 14, 2026
I hit this too with two GitHub accounts on the same machine. I have a patch for existing checkouts that fixes the host lookup and the account used for PRs. I use multiple GitHub accounts with SSH aliases.
In my case,
git@github.com-work:example-org/demo.gitgets treated as GitHub Self-Hosted athttps://github.com-work. T3 Code then runsgh auth token --hostname github.com-work, even though the SSH alias points togithub.com. That fails withGitHubNotSignedInError.The failure reaches
listChangeRequeststhroughThreadSettlementServiceV2.pullRequestFor→lookupBranchPullRequest. The branch cannot find its existing PR, and the PR inbox shows a credential error.The patch uses
ssh -Gto read the alias'sHostNamebefore provider detection and API lookup. Git still uses the original alias for fetches and pushes.For accounts, it reads
github.userfrom Git configuration. Whenghsupplies the token, a repo can select its account withgit config --local github.user YOUR_LOGIN. T3 Code then usesgh auth token --hostname github.com --user YOUR_LOGIN. Saved tokens and environment tokens still take priority.The inbox also needs to use that account. It currently assumes one account per host, so Authored, Reviewing, and
author:mecan use the wrong login. The patch uses each repo's account for those views and keeps API batches separate when the accounts differ. PR details and code views use the repo's account too.Here is the same public checkout, alias, account, and search in both builds. Before, the inbox fails to load:
Before: the PR inbox shows a GitHub credential error

With the patch, it finds the existing PR:
The PR description and changed files load too. These screenshots use public test data only.
All 689 focused tests pass on macOS, Linux, and Windows. I also tested two real accounts in the macOS app, including Authored,
author:me, PR details, and code.One new updated behavior I added: it reads global and conditional
github.uservalues too. If the selected account is signed out, it reports that instead of switching accounts.This covers existing GitHub.com checkouts. It does not change the clone flow or add Enterprise alias support.
Happy to put up a PR if this direction looks good.
my patch is here: https://github.com/hack-dance/t3code-1/compare/main...fix/ssh-remote-github-account
fix(git): treat SSH host aliases and any remote name as GitHub
tsmith165 commentedon Oct 22, 2026
Note
Claude Opus 5.5 in Claude Code, writing on behalf of @tsmith165. Measured on his Mac on 2026-10-22.
Same setup here: two GitHub accounts, with remotes like
git@github-personal:owner/repo.git. This is the server-side cost of the misdetection, fromserver.trace.ndjson.About 70 minutes spanning the 20261021 and 20261022 nightlies
GitHubCredentials.getfailed 233 times.ForgejoCli.listLoginsrantea234 times.PullRequestSyncReactor.syncGroupfailed 61 of 61 times with "Change requests cannot be browsed for this project's host yet."28 minutes on 0.1.2-nightly.20261022.3526 alone
GitHubCredentials.getfailed 16 of 16 times, taking up to 15.9 s each.ForgejoCli.listLoginsran 34 times, and 17 of those runs failed.The repeated
teaprobes and failed credential lookups add load on every PR sync pass. Resolving the alias first (ssh -G <alias>and readinghostname) would classify these remotes as github.com. @roodboi's patch above looks like it would cover this case.dgregorybm commentedon Oct 22, 2026
This is still happening with v0.1.0. Anyone know how to get the attention of @t3dotgg?
roodboi commentedon Oct 23, 2026
put up a PR for this: #23909. it resolves the alias with
ssh -Gso single-label ones likegithub-workwork too, not justgithub.com-*, and picks the gh account per repo viagithub.userso the inbox stops mixing logins. overlaps a bit with #22246 on the alias part, kept it compatible with that.felipefa commentedon Oct 23, 2026
Would love to get this issue fixed as well
Zedyas commentedon Oct 23, 2026
Another effect of using the SSH alias as the repository host: the same repo on two machines (desktop plus an SSH environment) never groups into one project when each machine reaches GitHub through a different alias. The names below are placeholders.
Setup
Desktop (macOS), one key per GitHub account:
Clones use the alias:
git@gh-personal:owner/repo.git.Server (Ubuntu, added in T3 Code as an SSH environment) acts as a separate machine-user account. Its repos were copied from the desktop, so they keep the desktop's remote URL, and the server's git rewrites that URL to its own alias:
Fetch and push work on both machines, and both remotes point at the same GitHub repository.
Steps to reproduce
owner/repo).Expected: the server is listed as a machine the project already runs on, and the sidebar shows one project.
Actual: only the desktop is listed, and the server appears under "Add to another machine", although the server already has the project registered (
t3 project addthere reports "An active project already exists").Cause
apps/server/src/project/RepositoryIdentityResolver.tsbuilds the identity fromgit remote -v. That output already hasurl.insteadOfapplied, so the server reportsgit@gh-bot:owner/repo.gitwhile the desktop reportsgit@gh-personal:owner/repo.git.normalizeGitRemoteUrl(packages/shared/src/git.ts) keeps the SCP-style host as written, givingcanonicalKeyvalues ofgh-personal/owner/repoon the desktop andgh-bot/owner/repoon the server.deriveRepositoryScopedKeyinpackages/client-runtime/src/state/projectGrouping.ts, throughrepositoryGroupingKeyOf), so the two environments' projects never meet.Either difference is enough on its own: two different aliases, or the same alias plus a URL rewrite on one side.
Relation to #23909
#23909 looks like it fixes this case too: its GitHub
refineRepositoryIdentityrewritescanonicalKey(andorigin.canonicalKey) to thessh -GHostName, so both machines would producegithub.com/owner/repo. Two requests if it goes ahead:normalizeGitRemoteUrlfor every provider would cover those too.Workaround
Make
git remote -vprint the same URL on both machines. On the server, drop theurl.insteadOfrewrites and give the server's Host block the desktop's alias as extra names, with the same key:Both machines then normalise to
gh-personal/owner/repo, and git on the server still uses its own key. The resolver caches a positive identity for 15 minutes, so restart the server (or wait) before checking.Version
0.1.3-nightly.20261023.3579 on both machines (desktop app on macOS 26.6.2; server on Ubuntu 26.04.1 LTS, reached over SSH).
roodboi commentedon Oct 23, 2026
#23909 would cover this for github since refineRepositoryIdentity rewrites the canonicalKey to the ssh -G HostName before the identity gets cached, so two envs with different github aliases end up with the same grouping key. added a regression test for that (two aliases, same host, same key) and it groups fine. github.com only though, so GHE / gitlab / self-hosted aliases still split.
doing the alias resolution at every provider makes sense too i think, but prob as a follow up? Like move into the shared resolver instead of living in each provider, and the other normalizeGitRemoteUrl callers (GitManager, AgentSessionScanner) would need it too or theyd still disagree on remotes. prob a bigger change than this PR/routing.
LeonHeidelbach commentedon Nov 2, 2026
Same problem with a self-hosted GitLab behind an SSH alias (nightly 0.1.7, November 2026). The remote is
git@gitlab-work:group/project.git, and~/.ssh/configmapsgitlab-worktoHostName gitlab.example.comwith a non-standardPort.glabis logged in togitlab.example.com(glab auth statuslists it, withssh_hostset to the alias).refineUnknownGitLabRemote) comparesgitlab-workagainst the hosts fromglab auth status, finds no match, and T3 falls back to GitHub credentials (GitHubNotSignedInError: No GitHub credential for gitlab-work).gitlab.example.comstaystate: nullwith "Change requests cannot be browsed for this project's host yet".Host gitlab.example.comentry with the alias's settings and point the remote at the real hostname. After that, sync works immediately.Resolving the alias with
ssh -Gbefore classifying, as suggested above, would fix this for GitLab too. The closed #23909 only handled github.com.