@@ -13,7 +13,6 @@ import {
1313 type ChatMessage ,
1414 type SessionPhase ,
1515 type Thread ,
16- type ThreadSession ,
1716} from "../types" ;
1817import { randomUUID } from "~/lib/utils" ;
1918import { type ComposerImageAttachment , type DraftThreadState } from "../composerDraftStore" ;
@@ -313,33 +312,27 @@ export interface LocalDispatchSnapshot {
313312 latestTurnRequestedAt : string | null ;
314313 latestTurnStartedAt : string | null ;
315314 latestTurnCompletedAt : string | null ;
316- sessionOrchestrationStatus : ThreadSession [ "orchestrationStatus" ] | null ;
317- sessionUpdatedAt : string | null ;
318315}
319316
320317export function createLocalDispatchSnapshot (
321318 activeThread : Thread | undefined ,
322319 options ?: { preparingWorktree ?: boolean } ,
323320) : LocalDispatchSnapshot {
324321 const latestTurn = activeThread ?. latestTurn ?? null ;
325- const session = activeThread ?. session ?? null ;
326322 return {
327323 startedAt : new Date ( ) . toISOString ( ) ,
328324 preparingWorktree : Boolean ( options ?. preparingWorktree ) ,
329325 latestTurnTurnId : latestTurn ?. turnId ?? null ,
330326 latestTurnRequestedAt : latestTurn ?. requestedAt ?? null ,
331327 latestTurnStartedAt : latestTurn ?. startedAt ?? null ,
332328 latestTurnCompletedAt : latestTurn ?. completedAt ?? null ,
333- sessionOrchestrationStatus : session ?. orchestrationStatus ?? null ,
334- sessionUpdatedAt : session ?. updatedAt ?? null ,
335329 } ;
336330}
337331
338332export function hasServerAcknowledgedLocalDispatch ( input : {
339333 localDispatch : LocalDispatchSnapshot | null ;
340334 phase : SessionPhase ;
341335 latestTurn : Thread [ "latestTurn" ] | null ;
342- session : Thread [ "session" ] | null ;
343336 hasPendingApproval : boolean ;
344337 hasPendingUserInput : boolean ;
345338 threadError : string | null | undefined ;
@@ -357,15 +350,12 @@ export function hasServerAcknowledgedLocalDispatch(input: {
357350 }
358351
359352 const latestTurn = input . latestTurn ?? null ;
360- const session = input . session ?? null ;
361353
362354 return (
363355 input . localDispatch . latestTurnTurnId !== ( latestTurn ?. turnId ?? null ) ||
364356 input . localDispatch . latestTurnRequestedAt !== ( latestTurn ?. requestedAt ?? null ) ||
365357 input . localDispatch . latestTurnStartedAt !== ( latestTurn ?. startedAt ?? null ) ||
366- input . localDispatch . latestTurnCompletedAt !== ( latestTurn ?. completedAt ?? null ) ||
367- input . localDispatch . sessionOrchestrationStatus !== ( session ?. orchestrationStatus ?? null ) ||
368- input . localDispatch . sessionUpdatedAt !== ( session ?. updatedAt ?? null )
358+ input . localDispatch . latestTurnCompletedAt !== ( latestTurn ?. completedAt ?? null )
369359 ) ;
370360}
371361
0 commit comments