File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed
Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change 11import type { KernelSpec , ServerConnection } from '@jupyterlab/services' ;
22import { BaseManager , KernelSpecManager } from '@jupyterlab/services' ;
33
4- import { URLExt } from '@jupyterlab/coreutils' ;
4+ import { PageConfig , URLExt } from '@jupyterlab/coreutils' ;
55
66import type { IKernelSpecs } from '@jupyterlite/services' ;
77import { LiteKernelSpecClient } from '@jupyterlite/services' ;
@@ -130,7 +130,11 @@ export class HybridKernelSpecManager
130130 // Silently ignore errors fetching local server specs
131131 }
132132 } else {
133- const isRemoteConfigured = ! ! baseUrl ;
133+ // In remote mode, check if user has explicitly configured a remote server URL
134+ // We check PageConfig directly because serverSettings.baseUrl falls back to
135+ // localhost when not configured, which would cause unnecessary failed requests
136+ const configuredBaseUrl = PageConfig . getOption ( 'hybridKernelsBaseUrl' ) ;
137+ const isRemoteConfigured = ! ! configuredBaseUrl ;
134138
135139 if ( isRemoteConfigured ) {
136140 const token = serverSettings . token ;
Original file line number Diff line number Diff line change @@ -183,10 +183,13 @@ export class HybridSessionManager
183183 }
184184
185185 /**
186- * Stop a session if it is needed .
186+ * Stop a session by path if it exists .
187187 */
188188 async stopIfNeeded ( path : string ) : Promise < void > {
189- // TODO
189+ const session = await this . findByPath ( path ) ;
190+ if ( session ) {
191+ await this . shutdown ( session . id ) ;
192+ }
190193 }
191194
192195 /**
You can’t perform that action at this time.
0 commit comments