From b7f29c553da202b2818aa0b5e99dc582aa7df5fc Mon Sep 17 00:00:00 2001 From: brandon-schabel Date: Tue, 14 Jan 2025 20:45:19 -0700 Subject: [PATCH] websocket reconnect config --- .../src/components/global-state/websocket-config-context.tsx | 4 ++++ packages/shared/src/global-state/global-state-schema.ts | 1 + 2 files changed, 5 insertions(+) diff --git a/packages/client/src/components/global-state/websocket-config-context.tsx b/packages/client/src/components/global-state/websocket-config-context.tsx index c10effd..567141b 100644 --- a/packages/client/src/components/global-state/websocket-config-context.tsx +++ b/packages/client/src/components/global-state/websocket-config-context.tsx @@ -269,7 +269,11 @@ export function GlobalStateWebsocketProvider({ children }: { children: React.Rea config: { url: SERVER_WS_ENDPOINT, messageHandlers, + autoReconnect: true, + reconnectIntervalMs: 500, + maxReconnectAttempts: 500, }, + }) const baseValue: BaseContextValue = useMemo(() => { diff --git a/packages/shared/src/global-state/global-state-schema.ts b/packages/shared/src/global-state/global-state-schema.ts index 4f44717..4d2a4f6 100644 --- a/packages/shared/src/global-state/global-state-schema.ts +++ b/packages/shared/src/global-state/global-state-schema.ts @@ -74,6 +74,7 @@ export const chatTabStateSchema = z.object({ linkSettings: linkSettingsSchema.optional(), // optional ollama url, for example if a user wanted to have per tab ollama instances // for example if a user had 5 ollama instances on their network + // TODO: this still needs to be implemented ollamaUrl: z.string().optional(), lmStudioUrl: z.string().optional(), });