@@ -210,21 +210,24 @@ export class SyncService {
210210 // Handle JSONL format (Copilot CLI)
211211 if ( sessionFile . endsWith ( '.jsonl' ) ) {
212212 const lines = content . trim ( ) . split ( '\n' ) ;
213- for ( const line of lines ) {
214- if ( ! line . trim ( ) ) { continue ; }
215- try {
216- const event = JSON . parse ( line ) ;
217- if ( ! event || typeof event !== 'object' ) { continue ; }
218-
219- const normalizedTs = this . utility . normalizeTimestampToMs ( event . timestamp ) ;
220- const eventMs = Number . isFinite ( normalizedTs ) ? normalizedTs : fileMtimeMs ;
221- if ( ! eventMs || eventMs < startMs ) { continue ; }
222-
223- const dayKey = this . utility . toUtcDayKey ( new Date ( eventMs ) ) ;
224- const model = ( event . model || 'gpt-4o' ) . toString ( ) ;
225-
226- // Log first few interactions from today's files for debugging
227- if ( isFileFromToday && processedLines < 3 ) {
213+ const todayKey = this . utility . toUtcDayKey ( now ) ;
214+ let lineCount = 0 ;
215+ let processedLines = 0 ;
216+
217+ for ( const line of lines ) {
218+ lineCount ++ ;
219+ if ( ! line . trim ( ) ) { continue ; }
220+ try {
221+ const event = JSON . parse ( line ) ;
222+ if ( ! event || typeof event !== 'object' ) { continue ; }
223+
224+ const normalizedTs = this . utility . normalizeTimestampToMs ( event . timestamp ) ;
225+ const eventMs = Number . isFinite ( normalizedTs ) ? normalizedTs : fileMtimeMs ;
226+ if ( ! eventMs || eventMs < startMs ) { continue ; }
227+
228+ const dayKey = this . utility . toUtcDayKey ( new Date ( eventMs ) ) ;
229+ const model = ( event . model || 'gpt-4o' ) . toString ( ) ;
230+ const isFileFromToday = dayKey === todayKey ;
228231 this . deps . log ( `Backend sync: file ${ sessionFile . split ( / [ / \\ ] / ) . pop ( ) } line ${ lineCount } : eventMs=${ new Date ( eventMs ) . toISOString ( ) } , dayKey=${ dayKey } , type=${ event . type } ` ) ;
229232 processedLines ++ ;
230233 }
0 commit comments