diff --git a/ui/desktop/src/main.ts b/ui/desktop/src/main.ts index ff746ea25c70..b9a18f59bdfc 100644 --- a/ui/desktop/src/main.ts +++ b/ui/desktop/src/main.ts @@ -593,6 +593,12 @@ const createChat = async ( ); goosedClients.set(mainWindow.id, goosedClient); + console.log('[Main] Waiting for backend server to be ready...'); + const serverReady = await checkServerStatus(goosedClient); + if (!serverReady) { + throw new Error('Backend server failed to start in time'); + } + // Let windowStateKeeper manage the window mainWindowState.manage(mainWindow); @@ -1059,7 +1065,6 @@ ipcMain.handle('get-goosed-host-port', async (event) => { if (!client) { return null; } - await checkServerStatus(client); return client.getConfig().baseUrl || null; });