@@ -65,6 +65,8 @@ async function writeSandboxInputs(
6565 opts : { sandboxId ?: string ; rootUser ?: boolean }
6666) : Promise < void > {
6767 if ( ! files ?. length ) return
68+ const fetchedByUrl : string [ ] = [ ]
69+ const writtenInline : string [ ] = [ ]
6870 for ( const file of files ) {
6971 if ( file . type === 'url' ) {
7072 const dir = file . path . slice ( 0 , file . path . lastIndexOf ( '/' ) )
@@ -76,6 +78,7 @@ async function writeSandboxInputs(
7678 ...( opts . rootUser ? { user : 'root' } : { } ) ,
7779 }
7880 )
81+ fetchedByUrl . push ( file . path )
7982 } catch ( error ) {
8083 throw new Error (
8184 `Failed to fetch mounted file into sandbox at ${ file . path } : ${ getErrorMessage ( error ) } `
@@ -87,14 +90,20 @@ async function writeSandboxInputs(
8790 file . path ,
8891 buf . buffer . slice ( buf . byteOffset , buf . byteOffset + buf . byteLength )
8992 )
93+ writtenInline . push ( file . path )
9094 } else {
9195 await sandbox . files . write ( file . path , file . content )
96+ writtenInline . push ( file . path )
9297 }
9398 }
94- logger . info ( 'Wrote sandbox input files' , {
99+ // Split counts so it's visible whether a mount was fetched in-sandbox (by presigned URL, no bytes
100+ // through the web process) or written inline.
101+ logger . info ( 'Materialized sandbox inputs' , {
95102 sandboxId : opts . sandboxId ,
96- fileCount : files . length ,
97- paths : files . map ( ( f ) => f . path ) ,
103+ fetchedByUrlCount : fetchedByUrl . length ,
104+ writtenInlineCount : writtenInline . length ,
105+ fetchedByUrl,
106+ writtenInline,
98107 } )
99108}
100109
0 commit comments