@@ -797,7 +797,7 @@ function getLaunchVisualStateDotClass(visualState: MemberLaunchVisualState): str
797797 case 'starting_stale' :
798798 return 'bg-amber-400' ;
799799 case 'registered_only' :
800- return SPAWN_DOT_COLORS . waiting ;
800+ return STATUS_DOT_COLORS . terminated ;
801801 case 'shell_only' :
802802 return 'bg-amber-400' ;
803803 case 'stale_runtime' :
@@ -807,6 +807,38 @@ function getLaunchVisualStateDotClass(visualState: MemberLaunchVisualState): str
807807 }
808808}
809809
810+ function getCurrentRuntimeOfflineVisualState (
811+ runtimeEntry : TeamAgentRuntimeEntry | undefined ,
812+ spawnStatus : MemberSpawnStatus | undefined ,
813+ spawnLaunchState : MemberLaunchState | undefined ,
814+ spawnRuntimeAlive : boolean | undefined
815+ ) : MemberLaunchVisualState {
816+ if ( runtimeEntry ?. livenessKind === 'registered_only' ) {
817+ return 'registered_only' ;
818+ }
819+ if (
820+ runtimeEntry ?. livenessKind === 'stale_metadata' ||
821+ runtimeEntry ?. livenessKind === 'not_found'
822+ ) {
823+ return 'stale_runtime' ;
824+ }
825+ if (
826+ runtimeEntry ?. alive === false &&
827+ ( runtimeEntry . livenessKind == null ||
828+ runtimeEntry . livenessKind === 'runtime_process' ||
829+ runtimeEntry . livenessKind === 'confirmed_bootstrap' )
830+ ) {
831+ return 'stale_runtime' ;
832+ }
833+ if (
834+ spawnRuntimeAlive === false &&
835+ ( spawnStatus === 'online' || spawnLaunchState === 'confirmed_alive' )
836+ ) {
837+ return 'stale_runtime' ;
838+ }
839+ return null ;
840+ }
841+
810842export function shouldDisplayMemberCurrentTask ( {
811843 member,
812844 isTeamAlive,
@@ -846,10 +878,10 @@ export function shouldDisplayMemberCurrentTask({
846878 ) {
847879 return false ;
848880 }
849- if ( runtimeEntry ?. alive === false && spawnStatus !== 'online' ) {
881+ if ( runtimeEntry ?. alive === false ) {
850882 return false ;
851883 }
852- if ( spawnRuntimeAlive === false && spawnStatus !== 'online' ) {
884+ if ( spawnRuntimeAlive === false ) {
853885 return false ;
854886 }
855887 return true ;
@@ -1039,13 +1071,26 @@ export function buildMemberLaunchPresentation({
10391071 leadActivity ?: LeadActivityState ;
10401072 nowMs ?: number ;
10411073} ) : MemberLaunchPresentation {
1074+ const currentRuntimeOfflineVisualState = getCurrentRuntimeOfflineVisualState (
1075+ runtimeEntry ,
1076+ spawnStatus ,
1077+ spawnLaunchState ,
1078+ spawnRuntimeAlive
1079+ ) ;
10421080 const hasConfirmedSpawnLaunch =
10431081 spawnLaunchState === 'confirmed_alive' && spawnBootstrapConfirmed === true ;
10441082 const effectiveSpawnStatus =
1045- hasConfirmedSpawnLaunch && ( spawnStatus === 'waiting' || spawnStatus === 'spawning' )
1083+ hasConfirmedSpawnLaunch &&
1084+ currentRuntimeOfflineVisualState == null &&
1085+ ( spawnStatus === 'waiting' || spawnStatus === 'spawning' )
10461086 ? 'online'
10471087 : spawnStatus ;
1048- const effectiveSpawnRuntimeAlive = hasConfirmedSpawnLaunch ? true : spawnRuntimeAlive ;
1088+ const effectiveSpawnRuntimeAlive =
1089+ currentRuntimeOfflineVisualState != null
1090+ ? false
1091+ : hasConfirmedSpawnLaunch
1092+ ? true
1093+ : spawnRuntimeAlive ;
10491094 const presenceLabel = getLaunchAwarePresenceLabel (
10501095 member ,
10511096 effectiveSpawnStatus ,
@@ -1100,21 +1145,12 @@ export function buildMemberLaunchPresentation({
11001145 launchVisualState = 'permission_pending' ;
11011146 } else if ( spawnBootstrapStalled === true ) {
11021147 launchVisualState = 'bootstrap_stalled' ;
1103- } else if ( ! hasConfirmedSpawnLaunch && runtimeEntry ?. livenessKind === 'shell_only' ) {
1148+ } else if ( currentRuntimeOfflineVisualState != null ) {
1149+ launchVisualState = currentRuntimeOfflineVisualState ;
1150+ } else if ( runtimeEntry ?. livenessKind === 'shell_only' ) {
11041151 launchVisualState = 'shell_only' ;
1105- } else if (
1106- ! hasConfirmedSpawnLaunch &&
1107- runtimeEntry ?. livenessKind === 'runtime_process_candidate'
1108- ) {
1152+ } else if ( runtimeEntry ?. livenessKind === 'runtime_process_candidate' ) {
11091153 launchVisualState = 'runtime_candidate' ;
1110- } else if ( ! hasConfirmedSpawnLaunch && runtimeEntry ?. livenessKind === 'registered_only' ) {
1111- launchVisualState = 'registered_only' ;
1112- } else if (
1113- ! hasConfirmedSpawnLaunch &&
1114- ( runtimeEntry ?. livenessKind === 'stale_metadata' ||
1115- runtimeEntry ?. livenessKind === 'not_found' )
1116- ) {
1117- launchVisualState = 'stale_runtime' ;
11181154 } else if ( ! hasConfirmedSpawnLaunch && startingIsStale ) {
11191155 launchVisualState = 'starting_stale' ;
11201156 } else if (
0 commit comments