Upload websocket.py
Browse files
backend/routes/websocket.py
CHANGED
|
@@ -121,6 +121,9 @@ async def websocket_endpoint(websocket: WebSocket, client_id: str):
|
|
| 121 |
except asyncio.CancelledError:
|
| 122 |
pass
|
| 123 |
|
|
|
|
|
|
|
|
|
|
| 124 |
# Check if we should reconnect
|
| 125 |
connection_alive = await gemini.check_connection()
|
| 126 |
print(
|
|
|
|
| 121 |
except asyncio.CancelledError:
|
| 122 |
pass
|
| 123 |
|
| 124 |
+
# Refresh reference in case receive_from_client swapped the connection (e.g., model switch)
|
| 125 |
+
gemini = connections.get(client_id, gemini)
|
| 126 |
+
|
| 127 |
# Check if we should reconnect
|
| 128 |
connection_alive = await gemini.check_connection()
|
| 129 |
print(
|