@@ -442,8 +442,9 @@ describe("V2 environment commands", () => {
442442 Effect . flip ,
443443 ) ;
444444 expect ( refused ) . toMatchObject ( {
445- _tag : "OrchestrationV2DelayedMessageUnsupportedError" ,
446- reason : "server" ,
445+ _tag : "OrchestrationV2DelayedMessageServerUnsupportedError" ,
446+ threadId : v2ThreadId ,
447+ message : "This environment cannot schedule messages. Update it to send later." ,
447448 } ) ;
448449 expect ( oldCommands ) . toEqual ( [ ] ) ;
449450
@@ -482,7 +483,11 @@ describe("V2 environment commands", () => {
482483 Effect . provideService ( EnvironmentSupervisor . EnvironmentSupervisor , supervisor ) ,
483484 Effect . flip ,
484485 ) ;
485- expect ( launch ) . toMatchObject ( { reason : "thread_launch" } ) ;
486+ expect ( launch ) . toMatchObject ( {
487+ _tag : "OrchestrationV2DelayedMessageThreadLaunchUnsupportedError" ,
488+ threadId : v2ThreadId ,
489+ message : "The first message of a new thread or worktree cannot be scheduled." ,
490+ } ) ;
486491 expect ( launches ) . toEqual ( [ ] ) ;
487492 expect ( commands ) . toHaveLength ( 1 ) ;
488493 } ) . pipe ( Effect . provide ( layerTestCrypto ) ) ,
@@ -539,8 +544,9 @@ describe("V2 environment commands", () => {
539544 Effect . flip ,
540545 ) ;
541546 expect ( refused ) . toMatchObject ( {
542- _tag : "OrchestrationV2DelayedMessageUnsupportedError" ,
543- reason : "server" ,
547+ _tag : "OrchestrationV2DelayedMessageServerUnsupportedError" ,
548+ threadId : v2ThreadId ,
549+ message : "This environment cannot schedule messages. Update it to send later." ,
544550 } ) ;
545551 expect ( oldCommands ) . toEqual ( [ ] ) ;
546552 expect ( commands ) . toEqual ( [ ] ) ;
0 commit comments