@@ -35,7 +35,6 @@ import {
3535 ThreadTurnStartRequestedPayload ,
3636 SnapShotAccessibility ,
3737 isProviderSendTurnSupportedImageMimeType ,
38- PROVIDER_SEND_TURN_MAX_FILE_BYTES ,
3938} from "./orchestration.ts" ;
4039import { ProviderInstanceId } from "./providerInstance.ts" ;
4140
@@ -358,9 +357,6 @@ it.effect("tolerates attachment types from newer builds when decoding messages",
358357 } ) ,
359358) ;
360359
361- // The tolerant member must not catch malformed known attachments: a file over
362- // the size cap or an image with a bad mime has to fail its own schema, not
363- // slide through the open one with those constraints unchecked.
364360it . effect ( "rejects malformed known attachment types instead of tolerating them" , ( ) =>
365361 Effect . gen ( function * ( ) {
366362 const base = {
@@ -380,10 +376,11 @@ it.effect("rejects malformed known attachment types instead of tolerating them",
380376 updatedAt : "2026-01-01T00:00:00.000Z" ,
381377 } ) ;
382378
383- const oversizedFile = yield * Effect . exit (
384- decode ( { ...base , type : "file" , sizeBytes : PROVIDER_SEND_TURN_MAX_FILE_BYTES + 1 } ) ,
385- ) ;
386- assert . strictEqual ( Exit . isFailure ( oversizedFile ) , true ) ;
379+ const largeFile = yield * decode ( { ...base , type : "file" , sizeBytes : 75_000_000 } ) ;
380+ assert . strictEqual ( largeFile . attachments ?. [ 0 ] ?. sizeBytes , 75_000_000 ) ;
381+
382+ const emptyFile = yield * Effect . exit ( decode ( { ...base , type : "file" , sizeBytes : 0 } ) ) ;
383+ assert . strictEqual ( Exit . isFailure ( emptyFile ) , true ) ;
387384
388385 const badMimeImage = yield * Effect . exit (
389386 decode ( { ...base , type : "image" , mimeType : "application/pdf" , sizeBytes : 12 } ) ,
0 commit comments