fix: normalize project session payloads

The sidebar had to understand cursorSessions, codexSessions,
and other provider buckets because /api/projects exposed
provider-shaped arrays.

That leaked backend adapter storage into project state and made
frontend behavior drift each time a provider needed another bucket
or exception.

Return one sessions list with provider metadata instead. Project
state, search, and running-session filtering now share one contract,
while provider-specific storage remains behind the backend boundary.
This commit is contained in:
Haileyesus
2026-06-15 13:43:18 +03:00
parent 2abb45636b
commit d0adddbbda
9 changed files with 72 additions and 234 deletions

View File

@@ -29,6 +29,7 @@ export interface ProjectSession {
updated_at?: string;
lastActivity?: string;
messageCount?: number;
provider?: LLMProvider;
__provider?: LLMProvider;
// Tags the session with the owning project's DB `projectId` so UI handlers
// (session switching, sidebar focus, etc.) can match against selectedProject.
@@ -60,10 +61,6 @@ export interface Project {
path?: string;
isStarred?: boolean;
sessions?: ProjectSession[];
cursorSessions?: ProjectSession[];
codexSessions?: ProjectSession[];
geminiSessions?: ProjectSession[];
opencodeSessions?: ProjectSession[];
sessionMeta?: ProjectSessionMeta;
taskmaster?: ProjectTaskmasterInfo;
[key: string]: unknown;