@@ -101,22 +101,29 @@ it.layer(layer)("OpenCodeDriver runtime selection", (it) => {
101101 } ) . pipe ( Effect . scoped ) ,
102102 ) ;
103103
104- it . effect ( "distinguishes an updated CLI from an older running loopback server" , ( ) =>
105- Effect . gen ( function * ( ) {
106- const runtime = {
107- ...openCode2Runtime ,
108- runOpenCodeCommand : ( ) =>
109- Effect . succeed ( { stdout : "opencode v2.1.2\n" , stderr : "" , code : 0 } ) ,
110- } as OpenCodeRuntime . OpenCodeRuntime [ "Service" ] ;
111- const instance = yield * create (
112- { serverUrl : "http://127.0.0.1:4096" } ,
113- replayOpenCodeServer ( OPENCODE_2_RESPONSES , "" ) ,
114- ) . pipe ( Effect . provideService ( OpenCodeRuntime . OpenCodeRuntime , runtime ) ) ;
104+ it . effect . each ( [ "2.1.2" , null ] ) (
105+ "reports the installed CLI version independently of the loopback server (%s)" ,
106+ ( installedVersion ) =>
107+ Effect . gen ( function * ( ) {
108+ const runtime = {
109+ ...openCode2Runtime ,
110+ runOpenCodeCommand : ( ) =>
111+ Effect . succeed ( {
112+ stdout :
113+ installedVersion === null ? "unrecognized" : `opencode v${ installedVersion } \n` ,
114+ stderr : "" ,
115+ code : 0 ,
116+ } ) ,
117+ } as OpenCodeRuntime . OpenCodeRuntime [ "Service" ] ;
118+ const instance = yield * create (
119+ { serverUrl : "http://127.0.0.1:4096" } ,
120+ replayOpenCodeServer ( OPENCODE_2_RESPONSES , "" ) ,
121+ ) . pipe ( Effect . provideService ( OpenCodeRuntime . OpenCodeRuntime , runtime ) ) ;
115122
116- const snapshot = yield * instance . snapshot . refresh ;
117- assert . strictEqual ( snapshot . version , "2.0.18" ) ;
118- assert . strictEqual ( snapshot . installedVersion , "2.1.2" ) ;
119- } ) . pipe ( Effect . scoped ) ,
123+ const snapshot = yield * instance . snapshot . refresh ;
124+ assert . strictEqual ( snapshot . version , "2.0.18" ) ;
125+ assert . strictEqual ( snapshot . installedVersion , installedVersion ) ;
126+ } ) . pipe ( Effect . scoped ) ,
120127 ) ;
121128
122129 it . effect ( "skips the installed CLI probe when a localhost provider is disabled" , ( ) =>
0 commit comments