cline/cline · error · Error

workspaceRoot must be an existing directory

Error message

workspaceRoot must be an existing directory

What it means

Error "workspaceRoot must be an existing directory" thrown in cline/cline.

Source

Thrown at sdk/packages/core/src/tasks/agenda-task-manager.ts:921

				status: "failed",
				currentRunId: null,
				error: message,
				updatedBy: TASK_MANAGER_ACTOR,
			}) ?? latestTask;
		this.activeRuns.delete(task.taskId);
		this.publish("task.run.failed", finalTask, finalRun);
	}

	private ensureScope(
		scope: "global" | "workspace",
		workspaceRoot?: string,
	): AgendaTaskSpecFileStore {
		const root = optionalTrimmed(workspaceRoot);
		if (scope === "workspace" && !root) {
			throw new Error("workspaceRoot is required for workspace task scope");
		}
		if (scope === "workspace" && !isExistingDirectory(root)) {
			throw new Error("workspaceRoot must be an existing directory");
		}
		const key = scope === "global" ? "global" : `workspace:${root}`;
		const existing = this.scopes.get(key);
		if (existing) return existing.store;
		const store = new AgendaTaskSpecFileStore({
			scope,
			workspaceRoot: root,
			taskSpecsDir: scope === "global" ? this.globalSpecsDir : undefined,
		});
		const watched: WatchedScope = { store };
		let cacheScope = true;
		try {
			store.ensureSpecsDir();
			const watchRoot = this.watchFiles
				? this.resolveWatchRoot(store.specsDir)
				: undefined;
			if (watchRoot !== undefined) {
				watched.watcher = watch(watchRoot, (_event, filename) => {

View on GitHub (pinned to 491b30b806)

When it happens

Trigger: Thrown at sdk/packages/core/src/tasks/agenda-task-manager.ts:921 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of cline/cline@491b30b806 (2026-08-25). Data as JSON: /api/errors/1cb46a83fc378b17. Report an issue: GitHub.