From 91cc00a9d0967552f8f310a89cea2fd2cd60c566 Mon Sep 17 00:00:00 2001 From: Auto Date: Thu, 15 Jan 2026 15:14:24 +0200 Subject: [PATCH] fix: add explicit in_progress=False to all feature creation paths Complete the defense-in-depth approach from PR #53 by adding explicit in_progress=False to all remaining feature creation locations. This ensures consistency with the MCP server pattern and prevents potential NULL values in the in_progress field. Changes: - server/routers/features.py: Add in_progress=False to create_feature() and create_features_bulk() endpoints - server/services/expand_chat_session.py: Add in_progress=False to _create_features_bulk() in the expand chat session - api/migration.py: Add in_progress field handling in JSON migration, reading from source data with False as default This follows up on PR #53 which added nullable=False constraints and fixed existing NULL values, but only updated the MCP server creation paths. Now all 6 feature creation locations explicitly set both passes=False and in_progress=False. Co-Authored-By: Claude Opus 4.5 --- api/migration.py | 1 + server/routers/features.py | 2 ++ server/services/expand_chat_session.py | 1 + 3 files changed, 4 insertions(+) diff --git a/api/migration.py b/api/migration.py index 7f9bfb8..e0d0c51 100644 --- a/api/migration.py +++ b/api/migration.py @@ -82,6 +82,7 @@ def migrate_json_to_sqlite( description=feature_dict.get("description", ""), steps=feature_dict.get("steps", []), passes=feature_dict.get("passes", False), + in_progress=feature_dict.get("in_progress", False), ) session.add(feature) imported_count += 1 diff --git a/server/routers/features.py b/server/routers/features.py index 4313ff7..755b9fa 100644 --- a/server/routers/features.py +++ b/server/routers/features.py @@ -175,6 +175,7 @@ async def create_feature(project_name: str, feature: FeatureCreate): description=feature.description, steps=feature.steps, passes=False, + in_progress=False, ) session.add(db_feature) @@ -411,6 +412,7 @@ async def create_features_bulk(project_name: str, bulk: FeatureBulkCreate): description=feature_data.description, steps=feature_data.steps, passes=False, + in_progress=False, ) session.add(db_feature) session.flush() # Flush to get the ID immediately diff --git a/server/services/expand_chat_session.py b/server/services/expand_chat_session.py index 3c4008b..f582e7b 100644 --- a/server/services/expand_chat_session.py +++ b/server/services/expand_chat_session.py @@ -403,6 +403,7 @@ class ExpandChatSession: description=f.get("description", ""), steps=f.get("steps", []), passes=False, + in_progress=False, ) session.add(db_feature) created_rows.append(db_feature)