feat(server): use the selected GitHub login in terminals and agent sessions - #20
Conversation
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
donnes
left a comment
There was a problem hiding this comment.
Reviewed all 15 changed files at 6b350b7. No verified correctness bugs or blocking findings. Two nonblocking test suggestions are attached inline.
Validation: 512 tests passed across nine focused suites covering account selection, terminal management, all six provider adapters, and GitHub CLI behavior. Server typecheck and diff whitespace checks passed.
Reviewed with GPT-6-Astra through the Codex harness in T3 Code.
…ransitions Each provider adapter now has a test proving the selected login's token reaches its process over an ambient token, including Codex's MCP merge and the Antigravity driver handoff. The account environment test covers selection changes, the one-minute token expiry on the test clock, and retrying after a failed lookup. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
# Conflicts: # apps/server/src/provider/Layers/AntigravityAdapter.ts
The GitHub CLI account chosen in Settings → Source Control only applied to T3 Code's own
ghcommands. Terminals and agent sessions usedgh's globally active login, so an agent runninggh pr createcould act as the wrong account. Switching withgh auth switchelsewhere also changed it mid-task, because that rewrites one config file shared by every process.Fix
GitHubCliAccountEnvironmentinsourceControl/GitHubCliAccountSelection.tsresolves the checkout's selected login, reads its token withgh auth token --user(cached for 1 minute), and returns it asGH_TOKEN/GITHUB_TOKEN, or the enterprise variables for GHES hosts. The active login is never switched, so multiple terminals, agents and T3 instances can use different accounts at once.serverUrlkeeps its own environment, because T3 doesn't start it.gh's active login and a warning is logged. T3's own GitHub actions still fail closed.Changing the selection applies to terminals and sessions started afterwards.
Tests
AntigravityAdapter.test.ts › serves client file reads and writes only inside the session rootsfails identically onmainon macOS (a/varvs/private/vartemp-path mismatch) and is unrelated.Done with Claude Opus 5.5 in Claude Code (T3 Code).
🤖 Generated with Claude Code