Skip to content

Commit cdd3302

Browse files
committed
🤖 Fix remaining startup delay: Don't load AIService for git status checks
Critical fix: The WORKSPACE_EXECUTE_BASH IPC handler was calling this.aiService.getWorkspaceMetadata() just to get the workspace path. This triggered lazy-load of AIService on first git status check, importing the massive AI SDK (~3s) and blocking all IPC calls. Solution: Use Config.findWorkspace() instead, which already returns both workspacePath and projectPath without needing AIService. Impact: - Git status checks no longer trigger AI SDK import - AI SDK only loads when first AI stream starts (actual use) - Eliminates the 3s pause user reported seeing before git status icons appear - Window appears instantly and is fully interactive immediately
1 parent c722dc2 commit cdd3302

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

‎src/services/ipcMain.ts‎

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -664,19 +664,14 @@ export class IpcMain {
664664
}
665665
) => {
666666
try {
667-
// Get workspace metadata to find workspacePath
668-
const metadataResult = await this.aiService.getWorkspaceMetadata(workspaceId);
669-
if (!metadataResult.success) {
670-
return Err(`Failed to get workspace metadata: ${metadataResult.error}`);
667+
// Get workspace path and project path from config (no need for AIService)
668+
const workspaceInfo = this.config.findWorkspace(workspaceId);
669+
if (!workspaceInfo) {
670+
return Err(`Workspace not found: ${workspaceId}`);
671671
}
672672

673-
const workspacePath = metadataResult.data.workspacePath;
674-
675-
// Find project path for this workspace to load secrets
676-
const workspaceInfo = this.config.findWorkspace(workspaceId);
677-
const projectSecrets = workspaceInfo
678-
? this.config.getProjectSecrets(workspaceInfo.projectPath)
679-
: [];
673+
const { workspacePath, projectPath } = workspaceInfo;
674+
const projectSecrets = this.config.getProjectSecrets(projectPath);
680675

681676
// Create scoped temp directory for this IPC call
682677
using tempDir = new DisposableTempDir("cmux-ipc-bash");

0 commit comments

Comments
 (0)