@@ -7635,8 +7635,8 @@ export default function ChatView(props: ChatViewProps) {
76357635 : t ( "chat.view.compactUnavailable" )
76367636 : null ;
76377637 // Tokens a stale Claude session would re-read on its next turn. While set,
7638- // the composer shows a Compact chip and Enter compacts first; turning the
7639- // chip off sends the next message with full history . Held queues and
7638+ // the composer offers Full/ Compact, defaulting to Full until the user opts
7639+ // into compaction . Held queues and
76407640 // multi-model sends never compact first, so the offer hides for them.
76417641 const resumeCompactionTokens =
76427642 activeContextWindow &&
@@ -7655,22 +7655,16 @@ export default function ChatView(props: ChatViewProps) {
76557655 } )
76567656 ? activeContextWindow . usedTokens
76577657 : null ;
7658- // Threads whose Compact chip is turned off. A send that starts its turn
7659- // clears its thread's entry; a failed send keeps it for the retry.
7660- const [ fullHistoryThreadKeys , setFullHistoryThreadKeys ] = useState < ReadonlySet < string > > (
7661- ( ) => new Set ( ) ,
7662- ) ;
7663- const keepFullHistory = fullHistoryThreadKeys . has ( routeThreadKey ) ;
7664- const setKeepFullHistory = ( threadKey : string , keep : boolean ) => {
7665- setFullHistoryThreadKeys ( ( current ) => {
7666- if ( current . has ( threadKey ) === keep ) return current ;
7667- const next = new Set ( current ) ;
7668- if ( keep ) next . add ( threadKey ) ;
7669- else next . delete ( threadKey ) ;
7670- return next ;
7671- } ) ;
7672- } ;
7673- const toggleKeepFullHistory = ( ) => setKeepFullHistory ( routeThreadKey , ! keepFullHistory ) ;
7658+ // Resuming a large thread must not silently replace history with a summary.
7659+ // Keep this explicit choice across sends and reloads, scoped to this client,
7660+ // environment, and thread. Existing installations start with full history.
7661+ const [ compactOnResume , setCompactOnResume ] = useLocalStorage (
7662+ `t3code:compact-on-resume:${ routeThreadKey } ` ,
7663+ false ,
7664+ Schema . Boolean ,
7665+ ) ;
7666+ const keepFullHistory = ! compactOnResume ;
7667+ const toggleKeepFullHistory = ( ) => setCompactOnResume ( ( compact ) => ! compact ) ;
76747668 const toggleKeepFullHistoryStable = useStableCallback ( toggleKeepFullHistory ) ;
76757669 const handleRestoreThreadBranch = ( ) => {
76767670 if ( ! canWriteSourceControl ) return ;
@@ -9187,9 +9181,8 @@ export default function ChatView(props: ChatViewProps) {
91879181 ) ;
91889182 const messageIdForSend = newMessageId ( ) ;
91899183 const messageCreatedAt = new Date ( ) . toISOString ( ) ;
9190- // A stale Claude session compacts before this message so the turn does not re-read the
9191- // old history. The message queues behind the /compact run, since steering into it is
9192- // rejected.
9184+ // Only an explicit Compact preference puts this message behind a /compact
9185+ // run. Full history sends through the normal dispatch path.
91939186 const compactBeforeSend =
91949187 resumeCompactionTokens !== null &&
91959188 ! keepFullHistory &&
@@ -9918,7 +9911,6 @@ export default function ChatView(props: ChatViewProps) {
99189911 failure = startResult ;
99199912 } else {
99209913 turnStartSucceeded = true ;
9921- setKeepFullHistory ( routeThreadKey , false ) ;
99229914 // The turn is under way and will spend quota, so that thread's limits
99239915 // snapshot is stale. Uploads may have outlasted a navigation, so only
99249916 // the sending thread's panel clears.
0 commit comments