diff --git a/crates/goose-server/src/tunnel/mod.rs b/crates/goose-server/src/tunnel/mod.rs index 2c4f2e3cf4..f412d69afd 100644 --- a/crates/goose-server/src/tunnel/mod.rs +++ b/crates/goose-server/src/tunnel/mod.rs @@ -145,14 +145,12 @@ impl TunnelManager { } fn generate_secret() -> String { - let mut rng = rand::rng(); - let bytes: Vec = (0..32).map(|_| rand::Rng::random(&mut rng)).collect(); + let bytes: [u8; 32] = rand::random(); hex::encode(bytes) } fn generate_agent_id() -> String { - let mut rng = rand::rng(); - let bytes: Vec = (0..16).map(|_| rand::Rng::random(&mut rng)).collect(); + let bytes: [u8; 16] = rand::random(); hex::encode(bytes) } diff --git a/ui/desktop/src/components/settings/tunnel/TunnelSection.tsx b/ui/desktop/src/components/settings/tunnel/TunnelSection.tsx index c49ed6da8b..eccbacff4a 100644 --- a/ui/desktop/src/components/settings/tunnel/TunnelSection.tsx +++ b/ui/desktop/src/components/settings/tunnel/TunnelSection.tsx @@ -54,6 +54,12 @@ export default function TunnelSection() { setShowQRModal(false); } catch (err) { setError(errorMessage(err, 'Failed to stop tunnel')); + try { + const status = await window.electron.getTunnelStatus(); + setTunnelStatus(status); + } catch (statusErr) { + console.error('Failed to fetch tunnel status after error:', statusErr); + } } }; diff --git a/ui/desktop/src/main.ts b/ui/desktop/src/main.ts index fb9e491da5..7bd21de32b 100644 --- a/ui/desktop/src/main.ts +++ b/ui/desktop/src/main.ts @@ -1282,7 +1282,7 @@ ipcMain.handle('get-tunnel-status', async () => { return await syncTunnelStatus(globalGoosedPort, SERVER_SECRET); } catch (error) { console.error('Error getting tunnel status:', error); - return { state: 'error', info: null }; + return { state: 'error', info: null, auto_start: false }; } });