feat: pick a base branch per repo for multi-repo isolated runs - #295
Merged
LoganRupe merged 1 commit intoSep 23, 2026
Merged
Conversation
A multi-repo isolated run based only the anchor repo on the chosen branch; every other repo branched off whatever it had checked out, and mobile's base-branch list was empty because it queried the directory holding the .code-workspace. prepareWorktree gains an optional repoBaseBranches list of per-repo picks. The server bases each non-anchor repo on its pick, else its own default branch (origin/HEAD), else its checkout, and "start from origin" now fetches per repo. The web composer shows a "+N repos" menu next to the anchor's base selector with a branch submenu per repo. Mobile lists the anchor repo's branches and leaves the rest to the server default. Fixes #113
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.
What Changed
prepareWorktreegains an optionalrepoBaseBranches: [{ repoRoot, baseBranch }], holding only explicit picks.baseBranchstill means the anchor repo, so older clients are unaffected.origin/HEAD, via a newGitWorkflowService.resolveDefaultBranch), else its checked-out branch. "Start from origin" now fetches in each repo, falling back to the local branch, and a default branch that only exists on origin still resolves.repoBaseBranchStore.ts), not incomposerDraftStore, to keep this out of the upstream draft store; a page reload drops them and the default applies..code-workspace, so the list was empty there, the same bug web had before b652075. Mobile has no per-repo picker; the other repos get the server'sorigin/HEADdefault.Behaviour change: with no pick, non-anchor repos now start from their default branch rather than whatever they have checked out, matching how the anchor already defaults.
Why
Fixes #113. One base selector couldn't serve N repos with different defaults (
master,dev,mainin the report). The anchor got the chosen base and every other repo silently branched off its current HEAD.Verified: the multi-repo bootstrap tests in
server.test.tscover a pick, anorigin/HEADdefault and per-repo start-from-origin; server, web, mobile and contracts typecheck clean. In a real dev build, withwebchecked out onfeature/xandorigin/HEADatdev, no pick gives adevworktree and pickingmaingivesmain, confirmed on disk.Limits: each submenu lists the repo's first 100 refs with no search.
UI Changes
Before/after, new isolated run in a two-repo project; the agent reports which branch the
webworktree came from:issue-113-before-after.mp4