fix: wire HermesConsoleModal WS into stale-token reload guard

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.
This commit is contained in:
kshitij
2026-08-04 15:19:37 +05:30
committed by kshitij
parent 19e697d9c3
commit b8b17b8cee
@@ -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;