feat(v3): implement session continuity, workspace teardown, StatusBar rewrite, subagent routing fix

P6: persistSessionForProject() saves agent state + messages to SQLite on
session complete. registerSessionProject() maps sessionId -> projectId.
ClaudeSession restoreMessagesFromRecords() restores cached messages on mount.

P7: clearAllAgentSessions() clears sessions on group switch. switchGroup()
calls clearAllAgentSessions() + resets terminal tabs.

P10: StatusBar rewritten for workspace store (group name, project count,
agent count, "BTerminal v3"). Subagent routing fixed: project-scoped
sessions skip layout pane creation (render in TeamAgentsPanel instead).
This commit is contained in:
Hibryda 2026-03-07 16:33:27 +01:00
parent 9766a480ed
commit e0056f811f
5 changed files with 156 additions and 31 deletions

View file

@ -130,6 +130,10 @@ export function getTotalCost(id: string): { costUsd: number; inputTokens: number
return { costUsd, inputTokens, outputTokens };
}
export function clearAllAgentSessions(): void {
sessions = [];
}
export function removeAgentSession(id: string): void {
// Also remove from parent's childSessionIds
const session = sessions.find(s => s.id === id);