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:
@@ -15,6 +15,9 @@ import type {
|
||||
PickupSessionRequest,
|
||||
StatusUpdateRequest,
|
||||
StatusUpdateResponse,
|
||||
ChatSessionCreateResponse,
|
||||
ChatMessageRequest,
|
||||
ChatMessageResponse,
|
||||
} from '@/types/ai-session'
|
||||
|
||||
export const aiSessionsApi = {
|
||||
@@ -23,6 +26,22 @@ export const aiSessionsApi = {
|
||||
return response.data
|
||||
},
|
||||
|
||||
async createChatSession(data: AISessionCreateRequest): Promise<ChatSessionCreateResponse> {
|
||||
const response = await apiClient.post<ChatSessionCreateResponse>('/ai-sessions', {
|
||||
...data,
|
||||
session_type: 'chat',
|
||||
})
|
||||
return response.data
|
||||
},
|
||||
|
||||
async sendChatMessage(sessionId: string, data: ChatMessageRequest): Promise<ChatMessageResponse> {
|
||||
const response = await apiClient.post<ChatMessageResponse>(
|
||||
`/ai-sessions/${sessionId}/chat`,
|
||||
data
|
||||
)
|
||||
return response.data
|
||||
},
|
||||
|
||||
async respondToStep(sessionId: string, data: StepResponseRequest): Promise<StepResponseResponse> {
|
||||
const response = await apiClient.post<StepResponseResponse>(
|
||||
`/ai-sessions/${sessionId}/respond`,
|
||||
@@ -49,6 +68,7 @@ export const aiSessionsApi = {
|
||||
|
||||
async listSessions(params?: {
|
||||
status?: string
|
||||
session_type?: string
|
||||
skip?: number
|
||||
limit?: number
|
||||
problem_domain?: string
|
||||
@@ -104,6 +124,10 @@ export const aiSessionsApi = {
|
||||
})
|
||||
},
|
||||
|
||||
async deleteSession(sessionId: string): Promise<void> {
|
||||
await apiClient.delete(`/ai-sessions/${sessionId}`)
|
||||
},
|
||||
|
||||
async pickupSession(sessionId: string, data: PickupSessionRequest): Promise<StepResponseResponse> {
|
||||
const response = await apiClient.post<StepResponseResponse>(
|
||||
`/ai-sessions/${sessionId}/pickup`,
|
||||
|
||||
Reference in New Issue
Block a user