@@ -59,14 +59,14 @@ type LaunchAgentBootstrapDoctorOutcome =
5959function noteGatewayRuntime (
6060 serviceRuntime : GatewayServiceRuntime | undefined ,
6161 env : Record < string , string | undefined > ,
62- ) : boolean {
62+ ) : void {
6363 const summary = formatGatewayRuntimeSummary ( serviceRuntime ) ;
6464 const hints = buildGatewayRuntimeHints ( serviceRuntime , {
6565 platform : process . platform ,
6666 env,
6767 } ) ;
6868 if ( ! summary && hints . length === 0 ) {
69- return false ;
69+ return ;
7070 }
7171
7272 const lines : string [ ] = [ ] ;
@@ -75,7 +75,6 @@ function noteGatewayRuntime(
7575 }
7676 lines . push ( ...hints ) ;
7777 note ( lines . join ( "\n" ) , "Gateway" ) ;
78- return true ;
7978}
8079
8180async function maybeRepairLaunchAgentBootstrap ( params : {
@@ -208,6 +207,8 @@ export async function maybeRepairGatewayDaemon(params: {
208207 const serviceRepairPolicy = resolveServiceRepairPolicy ( ) ;
209208 const serviceRepairExternal = isServiceRepairExternallyManaged ( serviceRepairPolicy ) ;
210209 const service = resolveGatewayService ( ) ;
210+ const isLocalDarwinGateway =
211+ process . platform === "darwin" && params . cfg . gateway ?. mode !== "remote" ;
211212 // systemd can throw in containers/WSL; treat as "not loaded" and fall back to hints.
212213 let loaded ;
213214 try {
@@ -225,8 +226,7 @@ export async function maybeRepairGatewayDaemon(params: {
225226 ...command . environment ,
226227 } satisfies NodeJS . ProcessEnv )
227228 : process . env ;
228- const shouldReadRuntime =
229- loaded || ( process . platform === "darwin" && params . cfg . gateway ?. mode !== "remote" ) ;
229+ const shouldReadRuntime = loaded || isLocalDarwinGateway ;
230230 if ( shouldReadRuntime ) {
231231 serviceRuntime = await service . readRuntime ( serviceEnv ) . catch ( ( ) => undefined ) ;
232232 }
@@ -237,7 +237,7 @@ export async function maybeRepairGatewayDaemon(params: {
237237 }
238238 }
239239
240- if ( process . platform === "darwin" && params . cfg . gateway ?. mode !== "remote" ) {
240+ if ( isLocalDarwinGateway ) {
241241 const gatewayRepair = serviceRuntime ?. missingGuiSession
242242 ? ( { status : "gui-session-unavailable" , detail : serviceRuntime . detail ?? "" } as const )
243243 : await maybeRepairLaunchAgentBootstrap ( {
@@ -296,7 +296,7 @@ export async function maybeRepairGatewayDaemon(params: {
296296
297297 if ( ! loaded ) {
298298 if (
299- process . platform === "darwin" &&
299+ isLocalDarwinGateway &&
300300 ( serviceRuntime ?. missingGuiSession ||
301301 serviceRuntime ?. missingSupervision ||
302302 serviceRuntime ?. cachedLabel )
0 commit comments