fix(FN-5256): skip cycle preflight when new task has no deps
The unconditional listTasks() in assertNoDependencyCycle was wasted work for the common no-dependency write and broke the same-agent duplicate intake fail-open path: tests that stub listTasks to throw had the cycle check consume the rejection before _maybeAutoArchiveSameAgentDuplicate's try/catch could swallow it, propagating the error out of createTask. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -3311,6 +3311,7 @@ export class TaskStore extends EventEmitter<TaskStoreEvents> {
|
||||
source: "createTask" | "createTaskWithReservedId" | "updateTask" | "replication",
|
||||
overrides?: Map<string, readonly string[]>,
|
||||
): Promise<void> {
|
||||
if (dependencies.length === 0 && !overrides) return;
|
||||
const lookup = await this.buildActiveTaskDependencyLookup(overrides);
|
||||
const cyclePath = detectDependencyCycle(taskId, dependencies, (candidateId) => lookup.get(candidateId));
|
||||
if (!cyclePath) return;
|
||||
|
||||
Reference in New Issue
Block a user