From b8b17b8cee50b85adb7fba6ea332dc06731b86f4 Mon Sep 17 00:00:00 2001 From: kshitij Date: Tue, 4 Aug 2026 15:19:37 +0530 Subject: [PATCH] fix: wire HermesConsoleModal WS into stale-token reload guard MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sibling site missed by PR #54022 — /api/console WebSocket in HermesConsoleModal.tsx has the same buildWsUrl → stale-token → 4401 close path as the PTY and events WebSockets. Without this guard, opening the console after a dashboard restart shows 'Console closed (4401). auth: token_mismatch' with no recovery. --- web/src/components/HermesConsoleModal.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/web/src/components/HermesConsoleModal.tsx b/web/src/components/HermesConsoleModal.tsx index 97a2824c79..4ce422c0ab 100644 --- a/web/src/components/HermesConsoleModal.tsx +++ b/web/src/components/HermesConsoleModal.tsx @@ -11,6 +11,7 @@ import { Button } from "@nous-research/ui/ui/components/button"; import { useModalBehavior } from "@/hooks/useModalBehavior"; import { useProfileScope } from "@/contexts/useProfileScope"; import { api } from "@/lib/api"; +import { maybeReloadForLoopbackWsAuthFailure } from "@/lib/dashboard-auth-reload"; import { cn, themedBody } from "@/lib/utils"; import { useTheme } from "@/themes"; @@ -423,6 +424,9 @@ export function HermesConsoleModal({ open, onClose }: HermesConsoleModalProps) { }; ws.onclose = (ev) => { + if (maybeReloadForLoopbackWsAuthFailure(ev.code)) { + return; + } wsRef.current = null; activeCommandRef.current = false; pendingCommandRef.current = null;