@@ -1436,10 +1436,15 @@ it.effect("a publish whose push fails still refreshes the new remote", () =>
14361436 ) ,
14371437) ;
14381438
1439- // Pruned history cannot be replayed: a cursor below the boundary must resync from a snapshot.
1440- it . effect . each ( [ "thread" , "shell" ] as const ) (
1441- "%s resume from a cursor below the pruned boundary loads a snapshot" ,
1442- ( scope ) =>
1439+ // Pruned history cannot be replayed: a cursor below the boundary must resync from a snapshot,
1440+ // or, for a shell client that loads it over HTTP, be told to without the server building one.
1441+ it . effect . each ( [
1442+ { scope : "thread" , httpSnapshotFallback : false } ,
1443+ { scope : "shell" , httpSnapshotFallback : false } ,
1444+ { scope : "shell" , httpSnapshotFallback : true } ,
1445+ ] as const ) (
1446+ "$scope resume from a cursor below the pruned boundary (HTTP fallback: $httpSnapshotFallback)" ,
1447+ ( { scope, httpSnapshotFallback } ) =>
14431448 Effect . gen ( function * ( ) {
14441449 const sql = yield * SqlClient . SqlClient ;
14451450 const now = "2026-10-13T00:00:00.000Z" ;
@@ -1463,11 +1468,18 @@ it.effect.each(["thread", "shell"] as const)(
14631468 ) VALUES (${ OrchestrationEventStore . EVENT_LOG_PRUNED_THROUGH } , 2, ${ second ! . sequence } , ${ now } )
14641469 ` ;
14651470 const subscription = Effect . gen ( function * ( ) {
1466- const stream =
1471+ const items : ReadonlyArray < unknown > =
14671472 scope === "thread"
1468- ? yield * subscribeOrchestrationV2Thread ( { threadId, afterSequence : first ! . sequence } )
1469- : yield * subscribeOrchestrationV2Shell ( { afterSequence : first ! . sequence } ) ;
1470- return stream ;
1473+ ? yield * Stream . runCollect (
1474+ yield * subscribeOrchestrationV2Thread ( { threadId, afterSequence : first ! . sequence } ) ,
1475+ )
1476+ : yield * Stream . runCollect (
1477+ yield * subscribeOrchestrationV2Shell ( {
1478+ afterSequence : first ! . sequence ,
1479+ ...( httpSnapshotFallback ? { httpSnapshotFallback : true as const } : { } ) ,
1480+ } ) ,
1481+ ) ;
1482+ return items ;
14711483 } ) ;
14721484 const exit = yield * subscription . pipe (
14731485 Effect . provideService ( ThreadManagement . ThreadManagementService , {
@@ -1489,7 +1501,10 @@ it.effect.each(["thread", "shell"] as const)(
14891501 } as ProjectEnrichment . ProjectEnrichmentService [ "Service" ] ) ,
14901502 Effect . exit ,
14911503 ) ;
1492- assert . deepEqual ( Exit . isFailure ( exit ) ? Cause . squash ( exit . cause ) : exit , "snapshot" ) ;
1504+ assert . deepEqual (
1505+ Exit . isFailure ( exit ) ? Cause . squash ( exit . cause ) : Array . from ( exit . value ) ,
1506+ httpSnapshotFallback ? [ { kind : "snapshot-required" } ] : "snapshot" ,
1507+ ) ;
14931508 } ) . pipe ( Effect . scoped , Effect . provide ( ReplayTestLayer ) ) ,
14941509) ;
14951510
0 commit comments