fix: wrong import alias overwrote project_name with bool

assistant_chat.py and spec_creation.py imported is_valid_project_name
(returns bool) aliased as validate_project_name. When used as
`project_name = validate_project_name(project_name)`, the project name
was replaced with True, causing "Project not found in registry" errors.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
nioasoft
2026-02-06 06:20:03 +02:00
parent 3c61496021
commit a752ece70c
2 changed files with 5 additions and 5 deletions

View File

@@ -26,7 +26,7 @@ from ..services.assistant_database import (
get_conversations, get_conversations,
) )
from ..utils.project_helpers import get_project_path as _get_project_path from ..utils.project_helpers import get_project_path as _get_project_path
from ..utils.validation import is_valid_project_name as validate_project_name from ..utils.validation import validate_project_name
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)

View File

@@ -21,7 +21,7 @@ from ..services.spec_chat_session import (
remove_session, remove_session,
) )
from ..utils.project_helpers import get_project_path as _get_project_path from ..utils.project_helpers import get_project_path as _get_project_path
from ..utils.validation import is_valid_project_name as validate_project_name from ..utils.validation import is_valid_project_name, validate_project_name
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
@@ -49,7 +49,7 @@ async def list_spec_sessions():
@router.get("/sessions/{project_name}", response_model=SpecSessionStatus) @router.get("/sessions/{project_name}", response_model=SpecSessionStatus)
async def get_session_status(project_name: str): async def get_session_status(project_name: str):
"""Get status of a spec creation session.""" """Get status of a spec creation session."""
if not validate_project_name(project_name): if not is_valid_project_name(project_name):
raise HTTPException(status_code=400, detail="Invalid project name") raise HTTPException(status_code=400, detail="Invalid project name")
session = get_session(project_name) session = get_session(project_name)
@@ -67,7 +67,7 @@ async def get_session_status(project_name: str):
@router.delete("/sessions/{project_name}") @router.delete("/sessions/{project_name}")
async def cancel_session(project_name: str): async def cancel_session(project_name: str):
"""Cancel and remove a spec creation session.""" """Cancel and remove a spec creation session."""
if not validate_project_name(project_name): if not is_valid_project_name(project_name):
raise HTTPException(status_code=400, detail="Invalid project name") raise HTTPException(status_code=400, detail="Invalid project name")
session = get_session(project_name) session = get_session(project_name)
@@ -95,7 +95,7 @@ async def get_spec_file_status(project_name: str):
This is used for polling to detect when Claude has finished writing spec files. This is used for polling to detect when Claude has finished writing spec files.
Claude writes this status file as the final step after completing all spec work. Claude writes this status file as the final step after completing all spec work.
""" """
if not validate_project_name(project_name): if not is_valid_project_name(project_name):
raise HTTPException(status_code=400, detail="Invalid project name") raise HTTPException(status_code=400, detail="Invalid project name")
project_dir = _get_project_path(project_name) project_dir = _get_project_path(project_name)