@@ -533,7 +533,6 @@ export class WebBridge {
533533 chats : data . chats ,
534534 config : this . buildSessionConfig ( data ) ,
535535 trust : data . trust ?? false ,
536- startedAt : data . startedAt ,
537536 } ;
538537 } catch ( err ) {
539538 console . error ( '[Bridge] Failed to parse session:connected' , err ) ;
@@ -694,10 +693,8 @@ export class WebBridge {
694693 * fallback). Messages are NOT loaded here — they are fetched on demand when
695694 * the user selects a chat via `loadChatMessages()`.
696695 *
697- * When the server provides a `startedAt` timestamp, only chats that were
698- * created or updated since the server started are shown. This prevents the
699- * sidebar from filling up with stale chats from previous server sessions.
700- * Chats that a user resumed (updated) after the server started are included.
696+ * All chats returned by the server are shown in the sidebar — the server
697+ * is the authority on which chats are valid.
701698 */
702699 private async restoreChats ( ) : Promise < void > {
703700 let summaries : ChatSummary [ ] | undefined = this . sessionState ?. chats ;
@@ -726,30 +723,6 @@ export class WebBridge {
726723
727724 if ( ! summaries ?. length ) return ;
728725
729- // Filter to only show chats from the current server session.
730- // A chat qualifies if it was created or updated after the server started,
731- // or if it is currently running (active right now).
732- const serverStartedAt = this . sessionState ?. startedAt ;
733- if ( serverStartedAt ) {
734- const startTime = new Date ( serverStartedAt ) . getTime ( ) ;
735- const before = summaries . length ;
736- summaries = summaries . filter ( ( s ) => {
737- // Always show currently running chats
738- if ( s . status === 'running' ) return true ;
739- // Show if updated (resumed) since server started.
740- // Timestamps may be epoch millis (number) or ISO strings.
741- const updated = s . updatedAt ? new Date ( s . updatedAt ) . getTime ( ) : 0 ;
742- if ( updated >= startTime ) return true ;
743- // Show if created since server started (and never updated)
744- if ( ! s . updatedAt ) {
745- const created = s . createdAt ? new Date ( s . createdAt ) . getTime ( ) : 0 ;
746- if ( created >= startTime ) return true ;
747- }
748- return false ;
749- } ) ;
750- console . log ( `[Bridge] Filtered chats: ${ before } total → ${ summaries . length } from current session` ) ;
751- }
752-
753726 if ( ! summaries ?. length ) return ;
754727
755728 console . log ( `[Bridge] Populating sidebar with ${ summaries . length } chat(s)` ) ;
0 commit comments