@@ -50,11 +50,6 @@ const make = Effect.gen(function* () {
5050 ) ;
5151 const resolve : MuseUsageHome [ "Service" ] [ "resolve" ] = Effect . fn ( "MuseUsageHome.resolve" ) (
5252 function * ( { binaryPath, environment, awaitRefresh } ) {
53- // Spawn failures surface asynchronously; without this a missing CLI would report as pending.
54- const resolveExecutable = yield * SpawnExecutableResolution ;
55- if ( resolveExecutable ( binaryPath , yield * HostProcess . Platform , environment ) === undefined ) {
56- return Option . some ( undefined ) ;
57- }
5853 // Cache keys compare structurally. Omitted and undefined variables both
5954 // disappear from the child process environment and must share an entry.
6055 const key = {
@@ -63,9 +58,14 @@ const make = Effect.gen(function* () {
6358 Object . entries ( environment ) . filter ( ( [ , value ] ) => value !== undefined ) ,
6459 ) ,
6560 } ;
66- if ( awaitRefresh ) return Option . some ( yield * Cache . get ( cache , key ) ) ;
6761 const settled = yield * Cache . getSuccess ( cache , key ) ;
6862 if ( Option . isSome ( settled ) ) return settled ;
63+ // Spawn failures surface asynchronously; without this a missing CLI would report as pending.
64+ const resolveExecutable = yield * SpawnExecutableResolution ;
65+ if ( resolveExecutable ( binaryPath , yield * HostProcess . Platform , environment ) === undefined ) {
66+ return Option . some ( undefined ) ;
67+ }
68+ if ( awaitRefresh ) return Option . some ( yield * Cache . get ( cache , key ) ) ;
6969 // Awaited in the layer scope so a departing caller cannot cancel discovery.
7070 yield * Effect . forkIn ( Cache . get ( cache , key ) , scope , { startImmediately : true } ) ;
7171 // A lookup that settled synchronously needs no refresh.
0 commit comments