feat: support base_branch in matrix YAML and --base-branch CLI flag#163
Merged
feat: support base_branch in matrix YAML and --base-branch CLI flag#163
Conversation
…loses #162) When launching matrix agents, worktrees are always branched from HEAD/main. This adds base_branch support so worktrees can branch from any ref via origin/<base_branch>, enabling workflows where a research branch with spec artifacts is the desired starting point. Changes: - MatrixEntry: add optional branch and base_branch fields - AdapterSlot: add optional branch and baseBranch fields - expandMatrix: propagate base_branch/branch to expanded slots - createWorktree: fetch and branch from origin/<baseBranch> when specified - orchestrateLaunch: pass slot-level or global baseBranch to worktree creation - CLI launch: add --base-branch option - Tests: 6 new tests covering specified/omitted/invalid base_branch Co-Authored-By: Claude Opus 4.6 (1M context) <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.
Summary
Add
base_branchfield to matrix YAML entries and--base-branchCLI flag so worktrees can branch off a non-main branch (e.g. a research branch with spec artifacts already present).Changes (6 files, +193/-9)
matrix-parser.ts—base_branchfield in matrix YAML, propagated to AdapterSlotslaunch-orchestrator.ts— globalbaseBranchfallback in OrchestrateOptsworktree.ts— fetchesorigin/<baseBranch>as start point for new branchescli.ts—--base-branchCLI flag wired to both orchestrated and single-adapter pathsUsage
CLI:
Matrix YAML:
Closes #162