Page - Chat Session

abstract

Direct-link route to a specific chat session. The session_id segment is a UUID that maps to ChatSession.id. On load, the page sets currentSessionId in the Zustand store so ChatInterface loads the correct session history.


Route

PropertyValue
Path/chat/[session_id]
Filefrontend/src/app/chat/[session_id]/page.tsx
Auth RequiredNo
Layoutfrontend/src/app/layout.tsx
Dynamic Segmentsession_id (UUID string)

Component Tree

RootLayout (layout.tsx)
└── ThemeProvider
    └── SidebarProvider
        ├── AppSidebar
        └── SidebarInset
            └── ChatInterface     ← receives session_id via store

Data Layer

Global State — Zustand

StoreFields ReadActions Called
useChatStorecurrentSessionId, selectedProvider, selectedModelsetCurrentSessionId (called on mount with URL param)

API Calls (within ChatInterface)

EndpointTriggerPurpose
GET /api/v1/chat/history/{session_id}On currentSessionId changeLoad message history
GET /api/v1/chat/ask-streamOn user message submitStream AI response

Page Lifecycle


Render Conditions

ConditionResult
Valid session_id in URLHistory loads; conversation continues
session_id not found (404 from API)ChatInterface shows error or empty state
Navigating awaySession stays in sidebar; currentSessionId updated

RoleLink
Global storeStore - ChatStore
Home pagePage - Home
History APIAPI-GET-v1-chat-history-id
DB parent tableDB - chatsession