mirror of
https://github.com/leonvanzyl/autocoder.git
synced 2026-02-01 06:53:36 +00:00
fix: make boolean fields resilient to NULL values
Problem: Features with NULL values in passes/in_progress fields caused Pydantic validation errors in the API. Solution - defense in depth: 1. Database model: Add nullable=False to passes and in_progress columns 2. Migration: Auto-fix existing NULL values to False on database connect 3. API layer: Handle NULL gracefully in feature_to_response (treat as False) 4. MCP server: Explicitly set in_progress=False when creating features This ensures: - New databases cannot have NULL boolean fields - Existing databases are auto-migrated on connect - Even if NULL values exist, they're handled gracefully at runtime Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -409,6 +409,7 @@ def feature_create_bulk(
|
||||
description=feature_data["description"],
|
||||
steps=feature_data["steps"],
|
||||
passes=False,
|
||||
in_progress=False,
|
||||
)
|
||||
session.add(db_feature)
|
||||
created_count += 1
|
||||
@@ -459,6 +460,7 @@ def feature_create(
|
||||
description=description,
|
||||
steps=steps,
|
||||
passes=False,
|
||||
in_progress=False,
|
||||
)
|
||||
session.add(db_feature)
|
||||
session.commit()
|
||||
|
||||
Reference in New Issue
Block a user