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.git gets treated as GitHub Self-Hosted at https://github.com-work. T3 Code then runs gh auth token --hostname github.com-work, even though the SSH alias points to github.com. That fails with GitHubNotSignedInError.
The failure reaches listChangeRequests through ThreadSettlementServiceV2.pullRequestFor โ lookupBranchPullRequest. The branch cannot find its existing PR, and the PR inbox shows a credential error.
The patch uses ssh -G to read the alias's HostName before provider detection and API lookup. Git still uses the original alias for fetches and pushes.
For accounts, it reads github.user from Git configuration. When gh supplies the token, a repo can select its account with git config --local github.user YOUR_LOGIN. T3 Code then uses gh 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:me can 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.user values 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