taskplane 0.5.6 → 0.5.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -190,17 +190,42 @@ export async function executeOrchBatch(
190
190
  // Worktrees branch from it; merges target it via update-ref.
191
191
  const opId = resolveOperatorId(orchConfig);
192
192
  const orchBranch = `orch/${opId}-${batchState.batchId}`;
193
- const branchResult = runGit(["branch", orchBranch, batchState.baseBranch], repoRoot);
194
- if (!branchResult.ok) {
195
- batchState.phase = "failed";
196
- batchState.endedAt = Date.now();
197
- const errDetail = branchResult.stderr || branchResult.stdout || "unknown error";
198
- batchState.errors.push(`Failed to create orch branch '${orchBranch}': ${errDetail}`);
199
- onNotify(`❌ Failed to create orch branch '${orchBranch}': ${errDetail}`, "error");
200
- return;
193
+
194
+ // In workspace mode, create the orch branch in every repo that might
195
+ // have tasks. In repo mode, create it only in the single repo.
196
+ if (workspaceConfig) {
197
+ let orchBranchFailed = false;
198
+ for (const [repoId, repoConf] of workspaceConfig.repos) {
199
+ const rRoot = repoConf.path;
200
+ const repoBranch = getCurrentBranch(rRoot) || "HEAD";
201
+ const result = runGit(["branch", orchBranch, repoBranch], rRoot);
202
+ if (result.ok) {
203
+ execLog("batch", batchState.batchId, `created orch branch in ${repoId}`, { orchBranch, base: repoBranch });
204
+ } else {
205
+ const errDetail = result.stderr || result.stdout || "unknown error";
206
+ execLog("batch", batchState.batchId, `failed to create orch branch in ${repoId}: ${errDetail}`);
207
+ batchState.phase = "failed";
208
+ batchState.endedAt = Date.now();
209
+ batchState.errors.push(`Failed to create orch branch '${orchBranch}' in ${repoId}: ${errDetail}`);
210
+ onNotify(`❌ Failed to create orch branch '${orchBranch}' in ${repoId}: ${errDetail}`, "error");
211
+ orchBranchFailed = true;
212
+ break;
213
+ }
214
+ }
215
+ if (orchBranchFailed) return;
216
+ } else {
217
+ const branchResult = runGit(["branch", orchBranch, batchState.baseBranch], repoRoot);
218
+ if (!branchResult.ok) {
219
+ batchState.phase = "failed";
220
+ batchState.endedAt = Date.now();
221
+ const errDetail = branchResult.stderr || branchResult.stdout || "unknown error";
222
+ batchState.errors.push(`Failed to create orch branch '${orchBranch}': ${errDetail}`);
223
+ onNotify(`❌ Failed to create orch branch '${orchBranch}': ${errDetail}`, "error");
224
+ return;
225
+ }
226
+ execLog("batch", batchState.batchId, "created orch branch", { orchBranch, baseBranch: batchState.baseBranch });
201
227
  }
202
228
  batchState.orchBranch = orchBranch;
203
- execLog("batch", batchState.batchId, "created orch branch", { orchBranch, baseBranch: batchState.baseBranch });
204
229
 
205
230
  onNotify(
206
231
  ORCH_MESSAGES.orchStarting(batchState.batchId, rawWaves.length, batchState.totalTasks),
@@ -1025,7 +1025,11 @@ export function mergeWaveByRepo(
1025
1025
 
1026
1026
  for (const group of repoGroups) {
1027
1027
  const groupRepoRoot = resolveRepoRoot(group.repoId, repoRoot, workspaceConfig);
1028
- const groupBaseBranch = resolveBaseBranch(group.repoId, groupRepoRoot, baseBranch, workspaceConfig);
1028
+ // In workspace mode with orch branch, always merge into the orch branch
1029
+ // (passed as baseBranch from engine.ts). Do NOT use resolveBaseBranch()
1030
+ // which returns the repo's current branch (e.g., develop), bypassing
1031
+ // the orch branch model entirely.
1032
+ const groupBaseBranch = baseBranch;
1029
1033
 
1030
1034
  execLog("merge", `W${waveIndex}`, `merging repo group: ${group.repoId ?? "(default)"}`, {
1031
1035
  repoRoot: groupRepoRoot,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taskplane",
3
- "version": "0.5.6",
3
+ "version": "0.5.7",
4
4
  "description": "AI agent orchestration for pi — parallel task execution with checkpoint discipline",
5
5
  "keywords": [
6
6
  "pi-package",