@@ -246,25 +246,18 @@ export const makeWithHosts = Effect.fn("DeviceService.makeWithHosts")(function*
246246 const summary = yield * host . summary ;
247247 if ( ! summary . platforms . some ( ( platform ) => platform . available ) ) return null ;
248248 const ready = yield * host
249- . ensureAgentReady ( ( phase ) =>
250- publish ( ( state ) => ( { ...state , hostStatus : phase , hostStatusDetail : undefined } ) ) . pipe (
251- Effect . asVoid ,
252- ) ,
253- )
249+ . ensureAgentReady ( ( phase ) => setHostStatus ( host . id , { status : phase } ) . pipe ( Effect . asVoid ) )
254250 . pipe (
255251 Effect . tapError ( ( error ) =>
256- publish ( ( state ) => ( {
257- ...state ,
258- hostStatus : "failed" ,
259- hostStatusDetail : error . message ,
260- } ) ) ,
252+ setHostStatus ( host . id , { status : "failed" , detail : error . message } ) ,
261253 ) ,
262254 Effect . mapError (
263255 ( error ) => new DeviceHostUnavailableError ( { hostId : host . id , reason : error . message } ) ,
264256 ) ,
265257 ) ;
266258 const hostSummaries = yield * Effect . forEach ( hosts . values ( ) , ( candidate ) => candidate . summary ) ;
267- yield * publish ( ( state ) => ( { ...state , hosts : hostSummaries , hostStatus : "ready" } ) ) ;
259+ yield * publish ( ( state ) => ( { ...state , hosts : hostSummaries } ) ) ;
260+ yield * setHostStatus ( host . id , { status : "ready" } ) ;
268261 return { hostId : host . id , ...ready } ;
269262 } , lifecycleLock . withPermit ) ;
270263
@@ -354,6 +347,7 @@ export const makeWithHosts = Effect.fn("DeviceService.makeWithHosts")(function*
354347 return yield * publish ( ( state ) => ( {
355348 ...state ,
356349 hosts : hostSummaries ,
350+ ...( ready . hostId === LOCAL_DEVICE_HOST_ID ? { hostStatusDetail : detail } : { } ) ,
357351 devices : [
358352 ...state . devices . filter ( ( device ) => device . hostId !== ready . hostId ) ,
359353 ...devices ,
@@ -421,6 +415,7 @@ export const makeWithHosts = Effect.fn("DeviceService.makeWithHosts")(function*
421415 ...state ,
422416 hostStatus : nextEnabled ? "idle" : "disabled" ,
423417 hostStatusDetail : undefined ,
418+ hostStatuses : { } ,
424419 devices : nextEnabled ? state . devices : [ ] ,
425420 sessions : nextEnabled ? state . sessions : [ ] ,
426421 bootingDevices : nextEnabled ? state . bootingDevices : [ ] ,
0 commit comments