@@ -56,12 +56,7 @@ export abstract class ChatPaneHistory extends ChatPaneReplyNavigation {
5656 if ( parseCatalogSessionKey ( state . sessionKey ) ) {
5757 return Boolean ( this . catalogCursor && ! this . catalogLoading ) ;
5858 }
59- const pagination = state . chatHistoryPagination ?? { hasMore : false } ;
60- if ( pagination !== this . nativePaginationSnapshot ) {
61- this . nativePaginationSnapshot = pagination ;
62- this . olderOffsetsSeen . clear ( ) ;
63- }
64- return pagination . hasMore && ! state . chatLoading ;
59+ return state . chatHistoryPagination . hasMore && ! state . chatLoading ;
6560 }
6661
6762 protected resetOlderMessagesViewport ( ) : void {
@@ -80,8 +75,6 @@ export abstract class ChatPaneHistory extends ChatPaneReplyNavigation {
8075 }
8176 this . transcriptScrollTop = null ;
8277 this . olderCursorsSeen . clear ( ) ;
83- this . olderOffsetsSeen . clear ( ) ;
84- this . nativePaginationSnapshot = null ;
8578 this . clearHistoryObserver ( ) ;
8679 }
8780
@@ -328,18 +321,15 @@ export abstract class ChatPaneHistory extends ChatPaneReplyNavigation {
328321 let prepended = false ;
329322 try {
330323 if ( catalogKey ) {
331- const previousCount = this . catalogMessages . length ;
332- const progressed = await this . loadCatalogSession ( catalogKey , true ) ;
333- prepended = progressed || this . catalogMessages . length > previousCount ;
324+ prepended = await this . loadCatalogSession ( catalogKey , true ) ;
334325 } else {
335326 const pagination = state . chatHistoryPagination ;
336- if ( ! pagination ? .hasMore ) {
327+ if ( ! pagination . hasMore ) {
337328 return false ;
338329 }
339330 const requestedOffset = pagination . nextOffset ;
340331 const expectedSessionId =
341332 typeof state . currentSessionId === "string" ? state . currentSessionId . trim ( ) : "" ;
342- this . olderOffsetsSeen . add ( requestedOffset ) ;
343333 const result = await loadOlderChatHistoryPage ( state , requestedOffset ) ;
344334 if ( ! result || generation !== this . olderLoadGeneration ) {
345335 return false ;
@@ -358,10 +348,7 @@ export abstract class ChatPaneHistory extends ChatPaneReplyNavigation {
358348 return true ;
359349 }
360350 const nextPagination = resolveChatHistoryPagination ( result ) ;
361- const exhausted =
362- ! nextPagination . hasMore ||
363- nextPagination . nextOffset <= requestedOffset ||
364- this . olderOffsetsSeen . has ( nextPagination . nextOffset ) ;
351+ const exhausted = ! nextPagination . hasMore || nextPagination . nextOffset <= requestedOffset ;
365352 const messages = Array . isArray ( result . messages ) ? result . messages : [ ] ;
366353 const nextMessages = this . prependUniqueNativeMessages ( messages , state . chatMessages ) ;
367354 const grew = nextMessages . length > state . chatMessages . length ;
@@ -375,7 +362,6 @@ export abstract class ChatPaneHistory extends ChatPaneReplyNavigation {
375362 }
376363 : nextPagination ;
377364 state . chatHistoryPagination = appliedPagination ;
378- this . nativePaginationSnapshot = appliedPagination ;
379365 state . lastError = null ;
380366 scheduleChatScroll ( state , false ) ;
381367 prepended = grew || ! exhausted ;
0 commit comments