From 2a390e96b9661b771fa9948c9023c69ba627ef48 Mon Sep 17 00:00:00 2001 From: ekko <152005280+EKKOLearnAI@users.noreply.github.com> Date: Thu, 7 May 2026 19:33:15 +0800 Subject: [PATCH] fix: lazy-connect terminal and cap reconnect attempts (#521) TerminalPanel was connecting on mount even when the drawer was closed and the terminal tab was inactive. Combined with reconnectAttempts resetting on every ws.onopen, this caused infinite reconnection loops that spawned PTY processes until system limits were hit. - Pass `visible` prop to TerminalPanel, only connect when terminal tab is actually shown - Move reconnectAttempts reset from ws.onopen to "created" handler so only successful PTY creation resets the counter - Remove unused onMounted import Fixes #509 Co-authored-by: Claude Opus 4.7 --- .../src/components/hermes/chat/DrawerPanel.vue | 2 +- .../components/hermes/chat/TerminalPanel.vue | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/packages/client/src/components/hermes/chat/DrawerPanel.vue b/packages/client/src/components/hermes/chat/DrawerPanel.vue index 7ef025d..a25e63f 100644 --- a/packages/client/src/components/hermes/chat/DrawerPanel.vue +++ b/packages/client/src/components/hermes/chat/DrawerPanel.vue @@ -63,7 +63,7 @@ function handleClose() {
- +
diff --git a/packages/client/src/components/hermes/chat/TerminalPanel.vue b/packages/client/src/components/hermes/chat/TerminalPanel.vue index 46e9f14..c64a09c 100644 --- a/packages/client/src/components/hermes/chat/TerminalPanel.vue +++ b/packages/client/src/components/hermes/chat/TerminalPanel.vue @@ -1,5 +1,5 @@