Desktop Code tab: PR not linked when origin uses an SSH host alias
The Code tab won't link a PR to a session when the git origin resolves to an SSH host alias. The same checkout works in OpenAI's Codex desktop app.
Setup
# ~/.ssh/config
Host org.github.com
HostName github.com
IdentitiesOnly yes
IdentityFile ~/.ssh/org_key
# ~/.gitconfig
[url "git@org.github.com:org/"]
insteadOf = git@github.com:org/
.git/config has url = git@github.com:org/repo.git, but git remote get-url origin returns git@org.github.com:org/repo.git.
Repro
- Open the checkout in a Code tab session, run
gh pr create. The PR is created but not linked. bind_prwith the PR URL fails:
> org/repo is not a repository this session works in (its checkout's origin remote, or one the user's sessions already have a PR bound from), so it can't be bound here.
org/repo matches origin; only the host differs.
Tried: repo-local overrides so git remote get-url origin returns git@github.com:org/repo.git while auth still works (url.<origin>.insteadOf <origin> plus core.sshCommand='ssh -F /dev/null -o IdentitiesOnly=yes -i ~/.ssh/org_key'). git fetch works, bind_pr still fails identically. Either the remote is cached at session start or the alias isn't the (only) cause. I did not retry in a fresh session.
Suggested fix: resolve aliases (ssh -G <host> → hostname) before matching, or match on owner/repo regardless of host, as the teleport docs already do for unparseable remotes. The error should say which check failed.
Related: #11126
Feedback reference id: 6db750d1-76af-4936-8299-70d07703920d