Skip to content

Commit 8bd1833

Browse files
committed
fixes
1 parent f40ecbb commit 8bd1833

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

src/kernelspec.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { KernelSpec, ServerConnection } from '@jupyterlab/services';
22
import { BaseManager, KernelSpecManager } from '@jupyterlab/services';
33

4-
import { URLExt } from '@jupyterlab/coreutils';
4+
import { PageConfig, URLExt } from '@jupyterlab/coreutils';
55

66
import type { IKernelSpecs } from '@jupyterlite/services';
77
import { 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;

src/session.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff 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
/**

0 commit comments

Comments
 (0)