Fix provider models per workspace (#1167)

* Scope provider snapshots by workspace

* Fix provider snapshot cwd test on Windows
This commit is contained in:
Mohamed Boudra
2026-05-25 17:12:15 +08:00
committed by GitHub
parent 6b35c0a640
commit f137705f1e
15 changed files with 336 additions and 91 deletions
@@ -381,7 +381,10 @@ function buildComposerConfig(input: {
const { serverId, isConnected, workspaceDirectory, sourceDirectory } = input;
return {
initialServerId: serverId || null,
initialValues: workspaceDirectory ? { workingDir: workspaceDirectory } : undefined,
initialValues:
workspaceDirectory || sourceDirectory
? { workingDir: workspaceDirectory || sourceDirectory }
: undefined,
isVisible: true,
onlineServerIds: isConnected && serverId ? [serverId] : [],
lockedWorkingDir: workspaceDirectory || sourceDirectory || undefined,
@@ -1502,8 +1502,9 @@ function WorkspaceScreenContent({
setIsImportSheetVisible(false);
}, []);
// Warm the global provider snapshot so the model picker is ready when opened.
// Warm the workspace-scoped provider snapshot so the model picker is ready when opened.
useProvidersSnapshot(normalizedServerId, {
cwd: workspaceDirectory,
enabled: isRouteFocused,
});