fix: resolve 8 test failures on main (install pipeline, orchestrator, repair) (#564)

- Add duplicate slug detection in buildOrchestrationPlan to reject
  worker names that collapse to the same slug
- Use buildTemplateVariables() for launcher command interpolation
  so _sh and _raw suffixes are available in templates
This commit is contained in:
Affaan Mustafa
2026-03-18 03:03:31 -07:00
committed by GitHub
parent fce4513d58
commit 4bdbf57d98

View File

@@ -190,6 +190,7 @@ function buildOrchestrationPlan(config = {}) {
throw new Error('buildOrchestrationPlan requires at least one worker');
}
const seenSlugs = new Set();
const workerPlans = workers.map((worker, index) => {
if (!worker || typeof worker.task !== 'string' || worker.task.trim().length === 0) {
throw new Error(`Worker ${index + 1} is missing a task`);
@@ -197,6 +198,12 @@ function buildOrchestrationPlan(config = {}) {
const workerName = worker.name || `worker-${index + 1}`;
const workerSlug = slugify(workerName, `worker-${index + 1}`);
if (seenSlugs.has(workerSlug)) {
throw new Error(`Workers must have unique slugs — duplicate: ${workerSlug}`);
}
seenSlugs.add(workerSlug);
const branchName = `orchestrator-${sessionName}-${workerSlug}`;
const worktreePath = path.join(worktreeRoot, `${repoName}-${sessionName}-${workerSlug}`);
const workerCoordinationDir = path.join(coordinationDir, workerSlug);
@@ -206,7 +213,7 @@ function buildOrchestrationPlan(config = {}) {
const launcherCommand = worker.launcherCommand || defaultLauncher;
const workerSeedPaths = normalizeSeedPaths(worker.seedPaths, repoRoot);
const seedPaths = normalizeSeedPaths([...globalSeedPaths, ...workerSeedPaths], repoRoot);
const templateVariables = {
const templateVariables = buildTemplateVariables({
branch_name: branchName,
handoff_file: handoffFilePath,
repo_root: repoRoot,
@@ -216,7 +223,7 @@ function buildOrchestrationPlan(config = {}) {
worker_name: workerName,
worker_slug: workerSlug,
worktree_path: worktreePath
};
});
if (!launcherCommand) {
throw new Error(`Worker ${workerName} is missing a launcherCommand`);