eyaltoledano/claude-task-master · error · MoveTaskError

CROSS_TAG_DEPENDENCY_CONFLICTS

CROSS_TAG_DEPENDENCY_CONFLICTS

Error message

Cannot move tasks: ${crossTagDependencies.length} cross-tag dependency conflicts found

What it means

This MoveTaskError with code CROSS_TAG_DEPENDENCY_CONFLICTS is thrown by the dependency resolution step during cross-tag moves when tasks being moved depend on tasks that will remain in the source tag (or vice versa), and the chosen resolution policy is to block rather than ignore. The error carries a conflicts payload listing the offending dependency edges, sourceTag, and targetTag so callers can present or resolve them.

Source

Thrown at scripts/modules/task-manager/move-task.js:800

					return true;
				});
			});

			log(
				'warn',
				`Removed ${crossTagDependencies.length} cross-tag dependencies`
			);

			return {
				tasksToMove: taskIds,
				dependencyResolution: {
					type: 'ignored-dependencies',
					conflicts: crossTagDependencies
				}
			};
		} else {
			// Block move and show error
			throw new MoveTaskError(
				MOVE_ERROR_CODES.CROSS_TAG_DEPENDENCY_CONFLICTS,
				`Cannot move tasks: ${crossTagDependencies.length} cross-tag dependency conflicts found`,
				{
					conflicts: crossTagDependencies,
					sourceTag,
					targetTag,
					taskIds
				}
			);
		}
	}

	return {
		tasksToMove: taskIds,
		dependencyResolution: { type: 'no-conflicts' }
	};
}

View on GitHub (pinned to c0c98d367c)

Solutions

  1. Include the dependent tasks in the same move (move the whole dependency chain together).
  2. Pass an explicit dependency resolution option to auto-rewrite or drop cross-tag dependencies, e.g. dependencyResolution: 'ignore' or 'remove', if losing the edge is acceptable.
  3. Inspect error.conflicts to identify the exact dependency edges, then resolve manually before moving.
  4. Update the task's dependencies to point at equivalents in the target tag, then retry.
  5. If strictness is unintended, change the move call's dependency policy rather than the data.

Example fix

// before
await moveTasksBetweenTags(tasksPath, ['7'], 'backlog', 'done'); // task 7 depends on task 5 in backlog
// after
await moveTasksBetweenTags(tasksPath, ['7'], 'done', {
  dependencyResolution: 'ignore' // or move tasks ['5','7'] together
});
Defensive patterns

Strategy: try-catch

Validate before calling

const data = JSON.parse(fs.readFileSync(tasksPath, 'utf8'));
const moving = new Set(taskIds.map(Number));
const conflicts = [];
for (const t of data[sourceTag].tasks) {
  if (moving.has(t.id)) {
    for (const d of t.dependencies ?? []) {
      if (!moving.has(d)) conflicts.push({ taskId: t.id, dependsOn: d });
    }
  }
}
if (conflicts.length) throw new Error(`Resolve ${conflicts.length} cross-tag deps first.`);

Try / catch

try {
  await moveTasksBetweenTags(tasksPath, taskIds, from, to);
} catch (e) {
  if (e.code === 'CROSS_TAG_DEPENDENCY_CONFLICTS') {
    const chain = [...new Set(e.details?.conflicts
      ?.flatMap(c => [c.taskId, c.dependsOn ?? c.dependencyId]) ?? [])];
    await moveTasksBetweenTags(tasksPath, chain, from, to);
  } else throw e;
}

Prevention

When it happens

Trigger: Calling moveTasksBetweenTags where a task in tasksToMove has a depends-on relationship with a task not included in the move, and dependencyResolution is set to 'error'/'block' (the default strict mode) instead of 'ignore' or a resolicy that rewrites dependencies.

Common situations: Moving one feature task while its prerequisite stays behind; bulk moves selecting a subset of a dependency chain; teams unaware tasks across tags cannot depend on each other; CI scripts that move tasks without specifying a dependency policy.

Related errors


AI-assisted analysis of eyaltoledano/claude-task-master@c0c98d367c (2026-08-29). Data as JSON: /api/errors/a32cdf7b0e1f013c. Report an issue: GitHub.