1
1
/* eslint-disable max-lines */
2
+ /* eslint-disable max-statements */
2
3
import type { ChatHistoryItem , Session } from "core/index.js" ;
3
4
import { useApp } from "ink" ;
4
5
import { useEffect , useRef , useState } from "react" ;
@@ -526,7 +527,7 @@ export function useChat({
526
527
} catch ( error ) {
527
528
// If compaction fails, remove the queued message from display
528
529
setQueuedMessages ( ( prev ) =>
529
- prev . filter ( ( msg ) => msg !== queuedMessageForDisplay )
530
+ prev . filter ( ( msg ) => msg !== queuedMessageForDisplay ) ,
530
531
) ;
531
532
throw error ; // Re-throw to maintain error handling
532
533
} finally {
@@ -541,14 +542,11 @@ export function useChat({
541
542
542
543
// Remove the queued message from display since it's now in chat history
543
544
setQueuedMessages ( ( prev ) =>
544
- prev . filter ( ( msg ) => msg !== queuedMessageForDisplay )
545
+ prev . filter ( ( msg ) => msg !== queuedMessageForDisplay ) ,
545
546
) ;
546
547
547
548
// Execute the streaming response with the updated history
548
- await executeStreamingResponse (
549
- newHistory ,
550
- currentCompactionIndex ,
551
- ) ;
549
+ await executeStreamingResponse ( newHistory , currentCompactionIndex ) ;
552
550
} else {
553
551
// Format message with attached files and images
554
552
logger . debug ( "Processing message with images" , {
@@ -596,7 +594,7 @@ export function useChat({
596
594
} catch ( error ) {
597
595
// If compaction fails, remove the triggering message from queue display
598
596
setQueuedMessages ( ( prev ) =>
599
- prev . filter ( ( msg ) => msg !== compactionQueuedMessage )
597
+ prev . filter ( ( msg ) => msg !== compactionQueuedMessage ) ,
600
598
) ;
601
599
throw error ; // Re-throw to maintain error handling
602
600
} finally {
@@ -611,7 +609,7 @@ export function useChat({
611
609
612
610
// Remove the triggering message from queue display since it's now in chat history
613
611
setQueuedMessages ( ( prev ) =>
614
- prev . filter ( ( msg ) => msg !== compactionQueuedMessage )
612
+ prev . filter ( ( msg ) => msg !== compactionQueuedMessage ) ,
615
613
) ;
616
614
617
615
// Execute the streaming response
0 commit comments