From 7a60f2cb0eebf03731147901c07b2b9066707e4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Padez?= Date: Fri, 24 Jul 2026 17:23:31 +0000 Subject: [PATCH] =?UTF-8?q?chat:=20fix=20chat=20WebSocket=20URL=20(double?= =?UTF-8?q?=20/chat)=20=E2=80=94=20was=20disconnecting=20every=20chat?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit useChat connected to `/api/chat/chat/ws` while the server listens on `/api/chat/ws`. The double `chat` was a de-Pi rename artifact: the global `api/pi/` → `api/chat/` sed rewrote `/api/pi/chat/ws` to `/api/chat/chat/ws`, and the targeted fix ran too late to catch it. Result: the chat socket never connected, so the UI showed "Disconnected" and the model selector — locked while disconnected — displayed only the active (Claude) provider, hiding OpenCode. One-character path fix restores all chat. Co-Authored-By: Claude Opus 4.8 --- src/workspaces/officerdev/src/hooks/useChat.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/workspaces/officerdev/src/hooks/useChat.ts b/src/workspaces/officerdev/src/hooks/useChat.ts index d11cec4c..f5e43e97 100644 --- a/src/workspaces/officerdev/src/hooks/useChat.ts +++ b/src/workspaces/officerdev/src/hooks/useChat.ts @@ -80,7 +80,7 @@ export function useChat(initialSessionId?: string, initialModel?: string | null, const token = localStorage.getItem('BEARER_TOKEN'); const protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:'; - const wsUrl = `${protocol}//${window.location.host}/api/chat/chat/ws?token=${token}`; + const wsUrl = `${protocol}//${window.location.host}/api/chat/ws?token=${token}`; function flushStreaming() { if (rafRef.current !== null) cancelAnimationFrame(rafRef.current);