Repository navigation
engine: fetch private repos for worktrees with the session GitHub token (WI-1666) - #1037
Merged
Merged
Conversation
added 3 commits
October 15, 2026 23:02
session_start worktree=true fetched origin as the engine user, whose credential cannot see private GitHub organisation repositories, and the failure came back as "Repository not found". The fetch now uses ENGINE_WORKTREE_GITHUB_TOKEN (or GH_TOKEN on the engine process) through GIT_ASKPASS only, and a GitHub origin with no token refuses by name.
Review of 8c2bdc6: the token was attached to every origin, github.com was matched as a substring, the askpass test wrapped git instead of running the shipped script, and tests leaked token env vars. The fetch now uses the token only for an https origin whose host is exactly github.com, askpass parses that host the same way, and the tests restore the environment.
The re-review of 4ef5e11 still had no test that git_command sets GIT_ASKPASS, blanks credential.helper, and strips GH_TOKEN, GITHUB_TOKEN and GIT_AUTH_TOKEN. A PATH git wrapper now records that environment for an https GitHub origin and checks the shipped askpass prints the worktree token. A second test shows a non-GitHub origin keeps its own credentials.
thedancingdeveloper
enabled auto-merge (rebase)
October 16, 2026 00:09
…odeQL, WI-1666) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The engine's worktree fetch now authenticates with the brokered GitHub token, so private repos work. The token never appears in argv, logs or .git/config. Three review rounds; the last found no blockers (handoff on WI-1666).
🤖 Generated with Claude Code