ruvnet/ruflo · error · Error

Cannot update task with status

Error message

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

What it means

handleUpdateTask found the task but its status is 'completed' or 'cancelled'. Terminal-state tasks are immutable, so applying further field updates is refused rather than silently resurrecting the task.

Solutions

  1. Only update tasks whose status permits modification.
  2. Check the task lifecycle and perform updates before completion or cancellation.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at v3/mcp/tools/task-tools.ts:689 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/b56b6b8bd306edba. Report an issue: GitHub.

Appendix: source

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

        updated: result.updated,
        updatedAt,
        changes: result.changes || {},
      };
    } catch (error) {
      console.error('Failed to update task via orchestrator:', error);
      // Fall through to simple implementation
    }
  }

  // Simple implementation
  const task = taskStore.get(input.taskId);
  if (!task) {
    throw new Error(`Task not found: ${input.taskId}`);
  }

  // Check if task can be updated
  if (task.status === 'completed' || task.status === 'cancelled') {
    throw new Error(`Cannot update task with status: ${task.status}`);
  }

  // Apply updates
  if (input.priority !== undefined && input.priority !== task.priority) {
    changes.priority = { from: task.priority, to: input.priority };
    task.priority = input.priority;
  }

  if (input.description !== undefined && input.description !== task.description) {
    changes.description = { from: task.description, to: input.description };
    task.description = input.description;
  }

  if (input.timeout !== undefined && input.timeout !== task.timeout) {
    changes.timeout = { from: task.timeout, to: input.timeout };
    task.timeout = input.timeout;
  }

View on GitHub (pinned to fa13ee4ad6)