Repository navigation
Replies: 1 comment
|
Same setup here: personal and work accounts on github.com, and neither can see the other's private repositories. Agents and terminals already get the right account per directory, because The active If project environment activation from #6715 lands, one option is for T3's GitHub calls to use a Tested on T3 Code 0.1.5 on Linux. Drafted with Claude Code. |
Uh oh!
There was an error while loading. Please reload this page.
simply put, i have one mac, multiple github accounts. personal, work, others...
using a zsh shortcut i had it specify different gh auth settings to different folders.
works perfect in terminal, but in t3code for the pr list is uses the main gh account, never checks if that specific project has different gh creds or not.
BELOW IS AI STUFF. 👇
Title
Per-project GitHub account for the PR section
What I want
Let a project choose which GitHub account T3 Code uses when it talks to
gh, so onemachine can hold a personal account and a work account and the PR section shows the right
identity for whichever project is open.
Today the PR section resolves one account for all of
github.com. Anyone with twoaccounts gets correct PRs for one of them and a wrong or signed-out view for the other.
How people already do this outside T3
ghscopes its whole identity to a config directory, so the usual setup is a per-folderGH_CONFIG_DIR:That works in a terminal and has no effect on T3.
Why it has no effect (at
324ddda31)Three things, in increasing order of work to fix:
GH_CONFIG_DIRnever reaches the server on desktop.apps/desktop/src/shell/DesktopShellEnvironment.ts:69copies only an allowlist of namesout of the login shell (
PATH,SSH_AUTH_SOCK,XDG_*, …), andGH_CONFIG_DIRisn'ton it. Launching T3 from a terminal inherits it and works; launching from the Dock
doesn't. Same machine, same account, two different answers.
ghis spawned directly, not through a shell.apps/server/src/sourceControl/GitHubCli.ts:328runsghwithcwdset to the projectroot and no
env, so it inherits the server's environment. A shell function or aliasnever runs, and the project's own directory can't influence which account answers.
Viewer identity is cached per host, not per project.
apps/server/src/pullRequest/PullRequestService.ts:710keysviewersByHoston the hoststring with a 10-minute TTL (
:117). Even ifghanswered differently percwd, everygithub.comproject would collapse into whichever viewer resolved first.Suggested shape
VcsProcessalready takes anenvpassthrough (apps/server/src/vcs/VcsProcess.ts:27),so most of the plumbing exists:
GH_CONFIG_DIR(or a general env overlay) and thread itthrough
GitHubCli.executeinto the spawn.viewersByHoston(host, configDir). Without this, one project's identity isserved to another out of the cache and the feature silently half-works.
Both together are what makes two accounts usable.
Smallest useful step
Adding
GH_CONFIG_DIRtoLOGIN_SHELL_ENV_NAMESfixes item 1 alone. That doesn't giveper-project accounts, but it does make a single non-default
ghconfig work on desktopinstead of reporting a logged-in user as signed out — and it's a one-line change that can
land independently of the rest.
Environment
0.0.34-nightly.20260819.1130ghinstalled via HomebrewAll reactions