git-branch: clone from GitHub when the repo is not in the local cache - #1583
Open
ivpusic wants to merge 1 commit into
Open
git-branch: clone from GitHub when the repo is not in the local cache#1583ivpusic wants to merge 1 commit into
ivpusic wants to merge 1 commit into
Conversation
git-branch only knew how to make a shared clone from the read-only repo-cache mount at ~/github. For any repo outside the deployment's cached set it failed with 'is not a valid git repository', which agents routinely misread as an infrastructure limitation - reporting to users that an admin must mount the repo, or attempting to clone into the read-only mount - when a plain authenticated clone into ~/branches works fine. Fall back to cloning https://github.com/<org>/<repo> into the writable branches dir when the repo is not cached, reuse an existing working copy before checking the cache, and say in the error message what to check when the remote clone fails. Also note in the system prompt that a repo missing from ~/github needs no admin action.
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.
git-branchonly knew how to make a shared clone from the read-only repo-cache mount at~/github, so for any repo outside a deployment's cached set it failed with "is not a valid git repository". Agents routinely misread that as an infrastructure limitation — telling users an admin must mount the repo, or trying to clone into the read-only mount — when an authenticated clone into~/branchesworks fine. We hit exactly this in our deployment: one session refused a PR request over this error while a same-model session recovered with a manualgh repo cloneand shipped its PR.Changes:
https://github.com/<org>/<repo>(sandbox git credentials apply) into~/branches/<org>/<repo>when the repo is not in the local cache~/branchesworking copy before checking the cache, so reuse also works for uncached repos~/githubis not a blocker and needs no admin actionTested all three paths locally (cached shared clone, GitHub fallback, nonexistent repo → clean error, exit 1).