refactor(startup): simplify stack to Tauri-managed OpenFang + optional ChromeDriver
- Remove OpenFang CLI dependency from startup scripts - OpenFang now bundled with Tauri and managed via gateway_start/gateway_status commands - Add bootstrap screen in App.tsx to auto-start local gateway before UI loads - Update Makefile: replace start-no-gateway with start-desktop-only - Fix gateway config endpoints: use /api/config instead of /api/config/quick - Add Playwright dependencies for future E2E testing
This commit is contained in:
@@ -219,6 +219,26 @@ export const useConnectionStore = create<ConnectionStore>((set, get) => {
|
||||
} catch {
|
||||
/* ignore local gateway preparation failures during connection bootstrap */
|
||||
}
|
||||
|
||||
// Auto-start local gateway if not running
|
||||
try {
|
||||
const localStatus = await fetchLocalGatewayStatus();
|
||||
const isRunning = localStatus.portStatus === 'busy' || localStatus.listenerPids.length > 0;
|
||||
|
||||
if (!isRunning && localStatus.cliAvailable) {
|
||||
console.log('[ConnectionStore] Local gateway not running, auto-starting...');
|
||||
set({ localGatewayBusy: true });
|
||||
await startLocalGatewayCommand();
|
||||
set({ localGatewayBusy: false });
|
||||
|
||||
// Wait for gateway to be ready
|
||||
await new Promise(resolve => setTimeout(resolve, 1500));
|
||||
console.log('[ConnectionStore] Local gateway started');
|
||||
}
|
||||
} catch (startError) {
|
||||
console.warn('[ConnectionStore] Failed to auto-start local gateway:', startError);
|
||||
set({ localGatewayBusy: false });
|
||||
}
|
||||
}
|
||||
|
||||
// Resolve effective token: param > quickConfig > localStorage > local auth
|
||||
|
||||
Reference in New Issue
Block a user