@@ -333,10 +333,9 @@ const make = Effect.gen(function* () {
333333 return ;
334334 }
335335
336- const currentTurnCount = thread . checkpoints . reduce (
337- ( maxTurnCount , checkpoint ) => Math . max ( maxTurnCount , checkpoint . checkpointTurnCount ) ,
338- 0 ,
339- ) ;
336+ const currentTurnCount = thread . checkpoints
337+ . filter ( ( checkpoint ) => checkpoint . status !== "missing" )
338+ . reduce ( ( maxTurnCount , checkpoint ) => Math . max ( maxTurnCount , checkpoint . checkpointTurnCount ) , 0 ) ;
340339 const baselineCheckpointRef = checkpointRefForThreadTurn ( thread . id , currentTurnCount ) ;
341340 const baselineExists = yield * checkpointStore . hasCheckpointRef ( {
342341 cwd : checkpointCwd ,
@@ -395,10 +394,9 @@ const make = Effect.gen(function* () {
395394 return ;
396395 }
397396
398- const currentTurnCount = thread . checkpoints . reduce (
399- ( maxTurnCount , checkpoint ) => Math . max ( maxTurnCount , checkpoint . checkpointTurnCount ) ,
400- 0 ,
401- ) ;
397+ const currentTurnCount = thread . checkpoints
398+ . filter ( ( checkpoint ) => checkpoint . status !== "missing" )
399+ . reduce ( ( maxTurnCount , checkpoint ) => Math . max ( maxTurnCount , checkpoint . checkpointTurnCount ) , 0 ) ;
402400 const baselineCheckpointRef = checkpointRefForThreadTurn ( threadId , currentTurnCount ) ;
403401 const baselineExists = yield * checkpointStore . hasCheckpointRef ( {
404402 cwd : checkpointCwd ,
@@ -451,10 +449,9 @@ const make = Effect.gen(function* () {
451449 return ;
452450 }
453451
454- const currentTurnCount = thread . checkpoints . reduce (
455- ( maxTurnCount , checkpoint ) => Math . max ( maxTurnCount , checkpoint . checkpointTurnCount ) ,
456- 0 ,
457- ) ;
452+ const currentTurnCount = thread . checkpoints
453+ . filter ( ( checkpoint ) => checkpoint . status !== "missing" )
454+ . reduce ( ( maxTurnCount , checkpoint ) => Math . max ( maxTurnCount , checkpoint . checkpointTurnCount ) , 0 ) ;
458455
459456 if ( event . payload . turnCount > currentTurnCount ) {
460457 yield * appendRevertFailureActivity ( {
0 commit comments