@@ -587,15 +587,49 @@ it.layer(layerTest)("CodexDriver", (it) => {
587587 tag : "rust-v0.164.0" ,
588588 status : 200 ,
589589 expected : null ,
590+ requestsChannel : false ,
590591 env : { CODEX_RELEASE : "0.162.0" } ,
591592 } ,
592593 {
593594 name : "an alternative installer channel" ,
594595 tag : "rust-v0.164.0" ,
595596 status : 200 ,
596597 expected : null ,
598+ requestsChannel : false ,
597599 env : { CODEX_INSTALLER_USE_RELEASES_OPENAI_COM : "false" } ,
598600 } ,
601+ {
602+ name : "an inherited explicit release" ,
603+ tag : "rust-v0.164.0" ,
604+ status : 200 ,
605+ expected : null ,
606+ requestsChannel : false ,
607+ hostEnv : { CODEX_RELEASE : "0.162.0" } ,
608+ } ,
609+ {
610+ name : "an inherited alternative installer channel" ,
611+ tag : "rust-v0.164.0" ,
612+ status : 200 ,
613+ expected : null ,
614+ requestsChannel : false ,
615+ hostEnv : { CODEX_INSTALLER_USE_RELEASES_OPENAI_COM : "false" } ,
616+ } ,
617+ {
618+ name : "instance settings overriding the host's pinned alternative channel" ,
619+ tag : "rust-v0.164.0" ,
620+ status : 200 ,
621+ expected : "0.164.0" ,
622+ hostEnv : { CODEX_RELEASE : "0.162.0" , CODEX_INSTALLER_USE_RELEASES_OPENAI_COM : "false" } ,
623+ env : { CODEX_RELEASE : "latest" , CODEX_INSTALLER_USE_RELEASES_OPENAI_COM : "true" } ,
624+ } ,
625+ {
626+ name : "empty instance settings restoring the default channel" ,
627+ tag : "rust-v0.164.0" ,
628+ status : 200 ,
629+ expected : "0.164.0" ,
630+ hostEnv : { CODEX_RELEASE : "0.162.0" , CODEX_INSTALLER_USE_RELEASES_OPENAI_COM : "false" } ,
631+ env : { CODEX_RELEASE : "" , CODEX_INSTALLER_USE_RELEASES_OPENAI_COM : "" } ,
632+ } ,
599633 ] ) {
600634 it . effect . skipIf ( windowsHost ) ( `checks the standalone channel for ${ fixture . name } ` , ( ) =>
601635 Effect . gen ( function * ( ) {
@@ -646,14 +680,22 @@ it.layer(layerTest)("CodexDriver", (it) => {
646680 } ) . pipe ( Effect . provideService ( HttpClient . HttpClient , http ) ) ;
647681 const capabilities = yield * instance . snapshot . resolveMaintenance ( ) ;
648682 expect ( requests ) . toEqual ( [ ] ) ;
649- if ( fixture . env ) {
683+ expect ( capabilities . update ?. env ) . toEqual ( {
684+ CODEX_HOME : home ,
685+ ...fixture . hostEnv ,
686+ ...fixture . env ,
687+ } ) ;
688+ if ( fixture . requestsChannel === false ) {
650689 const stable = yield * CodexDriver . create ( {
651690 instanceId : ProviderInstanceId . make ( "codex-stable-channel" ) ,
652691 displayName : "Codex stable channel" ,
653692 enabled : false ,
654693 environment : [ ] ,
655694 config : { ...CodexDriver . defaultConfig ( ) , binaryPath, homePath : home } ,
656- } ) . pipe ( Effect . provideService ( HttpClient . HttpClient , http ) ) ;
695+ } ) . pipe (
696+ Effect . provideService ( HttpClient . HttpClient , http ) ,
697+ Effect . provideService ( HostProcess . Environment , { } ) ,
698+ ) ;
657699 const stableCapabilities = yield * stable . snapshot . resolveMaintenance ( ) ;
658700 expect (
659701 yield * resolveLatestProviderVersion ( stableCapabilities ) . pipe (
@@ -670,7 +712,9 @@ it.layer(layerTest)("CodexDriver", (it) => {
670712 ) ;
671713 expect ( latest ) . toBe ( fixture . expected ) ;
672714 expect ( requests ) . toEqual (
673- fixture . env ? [ ] : [ "https://releases.openai.com/codex/channels/latest" ] ,
715+ fixture . requestsChannel === false
716+ ? [ ]
717+ : [ "https://releases.openai.com/codex/channels/latest" ] ,
674718 ) ;
675719 expect (
676720 createProviderVersionAdvisory ( {
@@ -688,7 +732,10 @@ it.layer(layerTest)("CodexDriver", (it) => {
688732 ) ;
689733 } ) . pipe (
690734 Effect . provideService ( ChildProcessSpawner . ChildProcessSpawner , noSpawn ) ,
691- Effect . provideService ( HostProcess . Environment , { } ) ,
735+ Effect . provideService ( HostProcess . Environment , {
736+ UNRELATED_HOST_SETTING : "not part of the update action" ,
737+ ...fixture . hostEnv ,
738+ } ) ,
692739 Effect . scoped ,
693740 ) ,
694741 ) ;
0 commit comments