@@ -10,6 +10,8 @@ interface StaleConversationCostDialogProps {
1010 /** Cumulative session cost so far, when the gateway reports it. */
1111 costUsd : number | null ;
1212 onContinue : ( ) => void ;
13+ /** Compact the history in place (runs `/compact`) instead of reloading it whole. */
14+ onCompact : ( ) => void ;
1315 onOpenChange : ( open : boolean ) => void ;
1416}
1517
@@ -19,6 +21,7 @@ export function StaleConversationCostDialog({
1921 lastActivityAt,
2022 costUsd,
2123 onContinue,
24+ onCompact,
2225 onOpenChange,
2326} : StaleConversationCostDialogProps ) {
2427 const activity =
@@ -40,8 +43,9 @@ export function StaleConversationCostDialog({
4043 message re-processes the whole conversation at full input price
4144 instead of the ~10% cached rate
4245 { costUsd !== null ? ` (≈$${ costUsd . toFixed ( 2 ) } spent so far)` : "" } .
43- Starting a new conversation avoids the cost — continue only if you
44- need this thread's context.
46+ Compacting summarizes the history so you keep this thread's context at
47+ a fraction of the size, or start a new conversation to avoid the cost
48+ entirely.
4549 </ AlertDialog . Description >
4650
4751 < Flex justify = "end" gap = "2" mt = "4" >
@@ -51,10 +55,15 @@ export function StaleConversationCostDialog({
5155 </ Button >
5256 </ AlertDialog . Cancel >
5357 < AlertDialog . Action >
54- < Button variant = "solid " size = "1" onClick = { onContinue } >
58+ < Button variant = "soft" color = "gray " size = "1" onClick = { onContinue } >
5559 Continue anyway
5660 </ Button >
5761 </ AlertDialog . Action >
62+ < AlertDialog . Action >
63+ < Button variant = "solid" size = "1" onClick = { onCompact } >
64+ Compact instead
65+ </ Button >
66+ </ AlertDialog . Action >
5867 </ Flex >
5968 </ AlertDialog . Content >
6069 </ AlertDialog . Root >
0 commit comments