You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 one
machine 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 two
accounts gets correct PRs for one of them and a wrong or signed-out view for the other.
How people already do this outside T3
gh scopes its whole identity to a config directory, so the usual setup is a per-folder GH_CONFIG_DIR:
GH_CONFIG_DIR never reaches the server on desktop. apps/desktop/src/shell/DesktopShellEnvironment.ts:69 copies only an allowlist of names
out of the login shell (PATH, SSH_AUTH_SOCK, XDG_*, …), and GH_CONFIG_DIR isn't
on it. Launching T3 from a terminal inherits it and works; launching from the Dock
doesn't. Same machine, same account, two different answers.
gh is spawned directly, not through a shell. apps/server/src/sourceControl/GitHubCli.ts:328 runs gh with cwd set to the project
root and no env, so it inherits the server's environment. A shell function or alias
never 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:710 keys viewersByHost on the host
string with a 10-minute TTL (:117). Even if gh answered differently per cwd, every github.com project would collapse into whichever viewer resolved first.
Suggested shape
VcsProcess already takes an env passthrough (apps/server/src/vcs/VcsProcess.ts:27),
so most of the plumbing exists:
Give a project an optional GH_CONFIG_DIR (or a general env overlay) and thread it
through GitHubCli.execute into the spawn.
Key viewersByHost on (host, configDir). Without this, one project's identity is
served 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_DIR to LOGIN_SHELL_ENV_NAMES fixes item 1 alone. That doesn't give
per-project accounts, but it does make a single non-default gh config work on desktop
instead of reporting a logged-in user as signed out — and it's a one-line change that can
land independently of the rest.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
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