fix: Ensure phase branches exist before task dispatch

Task dispatch computed baseBranch as the phase branch name but never
ensured it existed in the git clone. When phases weren't dispatched
through the PhaseDispatchManager (which creates branches), the
git worktree add failed with "fatal: invalid reference".

Now DefaultDispatchManager calls ensureBranch for both the initiative
and phase branches before spawning, matching what PhaseDispatchManager
already does.
This commit is contained in:
Lukas May
2026-03-05 20:49:21 +01:00
parent d81e0864f7
commit 50aea7e6f1
2 changed files with 32 additions and 0 deletions

View File

@@ -212,6 +212,9 @@ export async function createContainer(options?: ContainerOptions): Promise<Conta
repos.phaseRepository,
repos.agentRepository,
repos.pageRepository,
repos.projectRepository,
branchManager,
workspaceRoot,
);
const phaseDispatchManager = new DefaultPhaseDispatchManager(
repos.phaseRepository,