@@ -557,86 +557,6 @@ describe("driveOpenTasksAfterFleetDry", () => {
557557 ) . toBe ( original ) ;
558558 } ) ;
559559
560- test ( "send waits for async writeBlob before naming the URI" , async ( ) => {
561- const original = `head-${ "x" . repeat ( FLEET_DRY_REPORT_CHARS ) } TAIL-MARKER` ;
562- const records = new Map < string , FleetDryMailboxRecord > ( [
563- [ "big" , { status : "done" , report : original } ] ,
564- ] ) ;
565- const store = fakeBlobStore ( ) ;
566- let resolveWrite : ( ( ) => void ) | undefined ;
567- const writeBlob = ( key : string , bytes : Uint8Array , contentType : string ) =>
568- new Promise < void > ( ( resolve ) => {
569- resolveWrite = ( ) => {
570- store . writeBlob ( key , bytes , contentType ) ;
571- resolve ( ) ;
572- } ;
573- } ) ;
574- const sent : string [ ] = [ ] ;
575- const drivenP = driveOpenTasksAfterFleetDry ( {
576- previousRunning : 1 ,
577- running : 0 ,
578- openTasks : [ openTask ] ,
579- parentProcessing : false ,
580- mailbox : peekMailbox ( records ) ,
581- lanes : [ ] ,
582- writeBlob,
583- beginSystemContinuation : ( prompt ) => {
584- sent . push ( prompt ) ;
585- } ,
586- send : ( ) => undefined ,
587- } ) ;
588- await Promise . resolve ( ) ;
589- expect ( sent ) . toEqual ( [ ] ) ;
590- resolveWrite ?.( ) ;
591- expect ( await drivenP ) . toBe ( true ) ;
592- const uri = `tool-output:///${ fleetDrySpillKey ( "big" , "report" ) } ` ;
593- expect ( sent [ 0 ] ) . toContain ( uri ) ;
594- expect ( sent [ 0 ] ) . not . toContain ( "TAIL-MARKER" ) ;
595- const recovered = new TextDecoder ( ) . decode (
596- await createBlobReader ( store ) . read ( uri ) ,
597- ) ;
598- expect ( recovered ) . toBe ( original ) ;
599- } ) ;
600-
601- test ( "rejected writeBlob send is NOT retrievable and names no URI" , async ( ) => {
602- const original = "x" . repeat ( FLEET_DRY_REPORT_CHARS + 40 ) ;
603- const records = new Map < string , FleetDryMailboxRecord > ( [
604- [ "big" , { status : "done" , report : original } ] ,
605- ] ) ;
606- const rejections : unknown [ ] = [ ] ;
607- const onUnhandled = ( reason : unknown ) => {
608- rejections . push ( reason ) ;
609- } ;
610- process . on ( "unhandledRejection" , onUnhandled ) ;
611- try {
612- const sent : string [ ] = [ ] ;
613- const driven = await driveOpenTasksAfterFleetDry ( {
614- previousRunning : 1 ,
615- running : 0 ,
616- openTasks : [ openTask ] ,
617- parentProcessing : false ,
618- mailbox : peekMailbox ( records ) ,
619- lanes : [ ] ,
620- writeBlob : async ( ) => {
621- throw new Error ( "disk full" ) ;
622- } ,
623- beginSystemContinuation : ( prompt ) => {
624- sent . push ( prompt ) ;
625- } ,
626- send : ( ) => undefined ,
627- } ) ;
628- await Promise . resolve ( ) ;
629- expect ( driven ) . toBe ( true ) ;
630- const parsed = reportsJSONFromPrompt ( sent [ 0 ] ?? "" ) ;
631- const report = ( parsed as { report ?: string } [ ] ) [ 0 ] ?. report ?? "" ;
632- expect ( report ) . toContain ( "NOT retrievable" ) ;
633- expect ( report ) . not . toContain ( "tool-output:///" ) ;
634- expect ( rejections ) . toEqual ( [ ] ) ;
635- } finally {
636- process . off ( "unhandledRejection" , onUnhandled ) ;
637- }
638- } ) ;
639-
640560 test ( "dry+terminal, live+open, and parentProcessing only skip" , ( ) => {
641561 const noop = {
642562 mailbox : undefined ,
0 commit comments