feat: unified sessions — merge assistant chat into ai_sessions table
Add session_type ('guided'|'chat') and title columns to ai_sessions,
enabling both FlowPilot guided sessions and assistant chat sessions to
live in a single table. This is the foundation for a unified session
history and consistent UX across both interaction modes.
Backend:
- Migration 066: session_type + title columns
- unified_chat_service: chat sessions on ai_sessions with same AI/RAG
- POST /ai-sessions supports session_type='chat' creation
- POST /ai-sessions/{id}/chat for chat messages
- DELETE /ai-sessions/{id} for session deletion
- session_type filter on GET /ai-sessions
Frontend:
- AssistantChatPage rewired to aiSessionsApi (no more assistantChatApi)
- /assistant/:sessionId route for deep-linking
- Session history: type filter pills (All/Guided/Chat), type icons
- Dashboard: both types shown with correct routing and icons
- Fixed glass-border → border-default in dashboard components
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
"""Add session_type and title columns to ai_sessions for unified sessions.
|
||||
|
||||
Revision ID: 066
|
||||
Revises: 065
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
revision = "066"
|
||||
down_revision = "065"
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
op.add_column(
|
||||
"ai_sessions",
|
||||
sa.Column(
|
||||
"session_type",
|
||||
sa.String(10),
|
||||
nullable=False,
|
||||
server_default="guided",
|
||||
comment="Session type: guided (FlowPilot) or chat (assistant)",
|
||||
),
|
||||
)
|
||||
op.add_column(
|
||||
"ai_sessions",
|
||||
sa.Column(
|
||||
"title",
|
||||
sa.String(255),
|
||||
nullable=True,
|
||||
comment="Display title for chat sessions; guided sessions use problem_summary",
|
||||
),
|
||||
)
|
||||
op.create_index("ix_ai_sessions_session_type", "ai_sessions", ["session_type"])
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
op.drop_index("ix_ai_sessions_session_type", table_name="ai_sessions")
|
||||
op.drop_column("ai_sessions", "title")
|
||||
op.drop_column("ai_sessions", "session_type")
|
||||
Reference in New Issue
Block a user