ruvnet/ruflo · error · Error

Cannot assign task with status: ${task.status}

Error message

Cannot assign task with status: ${task.status}

What it means

handleAssignTask found the task but its status is terminal — 'completed', 'cancelled', or 'failed'. Assigning work to a finished task is an invalid state transition, so the assignment is refused and the offending status is included in the message.

Source

Thrown at v3/mcp/tools/task-tools.ts:630

  if (!task) {
    throw new Error(`Task not found: ${input.taskId}`);
  }

  const previousAgent = task.assignedTo;

  // Check if task can be assigned
  if (task.assignedTo && !input.reassign) {
    return {
      taskId: input.taskId,
      agentId: input.agentId,
      assigned: false,
      assignedAt,
      previousAgent,
    };
  }

  if (task.status === 'completed' || task.status === 'cancelled' || task.status === 'failed') {
    throw new Error(`Cannot assign task with status: ${task.status}`);
  }

  // Assign the task
  task.assignedTo = input.agentId;
  task.status = 'assigned';
  task.updatedAt = assignedAt;

  return {
    taskId: input.taskId,
    agentId: input.agentId,
    assigned: true,
    assignedAt,
    previousAgent,
  };
}

/**
 * Update task properties

View on GitHub (pinned to fa13ee4ad6)

Solutions

  1. Only assign tasks in a pending or queued status.
  2. Reset or recreate the task if it is in a terminal state.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at v3/mcp/tools/task-tools.ts:630 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of ruvnet/ruflo@fa13ee4ad6 (2026-08-18). Data as JSON: /api/errors/b5ca75932df6bd78. Report an issue: GitHub.