From 3da714e8bf051eba3ac7d4fb1e5261f0bd982327 Mon Sep 17 00:00:00 2001 From: Christian Gick Date: Tue, 20 Jan 2026 18:04:05 +0200 Subject: [PATCH] fix: Add 'pending' status to task status enum Resolves MCP error when trying to set status="pending" on tasks. Changes: - Migration 019: Add 'pending' to tasks.status CHECK constraint - Update task_update tool schema to accept 'pending' status - Update task_list tool schema to filter by 'pending' status Status meanings: - pending: Created, awaiting approval or dependencies - open: Approved and ready to start - in_progress: Currently being worked on - testing: Implementation complete, being tested - blocked: Stuck waiting for something - completed: Done Co-Authored-By: Claude Sonnet 4.5 --- migrations/019_add_pending_status.sql | 21 +++++++++++++++++++++ src/tools/index.ts | 4 ++-- 2 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 migrations/019_add_pending_status.sql diff --git a/migrations/019_add_pending_status.sql b/migrations/019_add_pending_status.sql new file mode 100644 index 0000000..c588f5b --- /dev/null +++ b/migrations/019_add_pending_status.sql @@ -0,0 +1,21 @@ +-- Add "pending" as valid task status +-- +-- Migration: 019_add_pending_status +-- Purpose: Add "pending" status to support tasks awaiting approval/dependencies +-- +-- Status meanings: +-- - pending: Created, awaiting approval or dependencies +-- - open: Approved and ready to start +-- - in_progress: Currently being worked on +-- - testing: Implementation complete, being tested +-- - blocked: Stuck waiting for something +-- - completed: Done +-- +-- Related: MCP error when trying to set status="pending" + +-- Drop existing constraint +ALTER TABLE tasks DROP CONSTRAINT IF EXISTS tasks_status_check; + +-- Add new constraint with pending status +ALTER TABLE tasks ADD CONSTRAINT tasks_status_check + CHECK (status IN ('pending', 'open', 'in_progress', 'testing', 'blocked', 'completed')); diff --git a/src/tools/index.ts b/src/tools/index.ts index bb3a311..bd63dae 100644 --- a/src/tools/index.ts +++ b/src/tools/index.ts @@ -24,7 +24,7 @@ export const toolDefinitions = [ type: 'object', properties: { project: { type: 'string', description: 'Filter by project key' }, - status: { type: 'string', enum: ['open', 'in_progress', 'testing', 'blocked', 'completed'], description: 'Filter by status' }, + status: { type: 'string', enum: ['pending', 'open', 'in_progress', 'testing', 'blocked', 'completed'], description: 'Filter by status' }, type: { type: 'string', enum: ['task', 'bug', 'feature', 'debt', 'investigation'], description: 'Filter by type' }, priority: { type: 'string', enum: ['P0', 'P1', 'P2', 'P3'], description: 'Filter by priority' }, limit: { type: 'number', description: 'Max results (default: 20)' }, @@ -60,7 +60,7 @@ export const toolDefinitions = [ type: 'object', properties: { id: { type: 'string', description: 'Task ID to update' }, - status: { type: 'string', enum: ['open', 'in_progress', 'testing', 'blocked', 'completed'], description: 'New status' }, + status: { type: 'string', enum: ['pending', 'open', 'in_progress', 'testing', 'blocked', 'completed'], description: 'New status' }, priority: { type: 'string', enum: ['P0', 'P1', 'P2', 'P3'], description: 'New priority' }, type: { type: 'string', enum: ['task', 'bug', 'feature', 'debt', 'investigation'], description: 'New type' }, title: { type: 'string', description: 'New title' },