OpenInterpreter / 01

The #1 open-source voice interface for desktop, mobile, and ESP32 chips.
https://01.openinterpreter.com/
GNU Affero General Public License v3.0
4.92k stars 517 forks source link

Resolving the Disconnect Message #250

Open rbrisita opened 5 months ago

rbrisita commented 5 months ago

This resolves #127. The 01OS will print the 'Cannot call "receive" once a disconnect message has been received.' message because the ping of the websockets.connect call does not set the ping_timeout to None; its default is 20 seconds. Slower computers running locally will receive this quite a bit; this is the "heartbeat". The ping_interval is the "keepalive" ping that could also be turned off but I personally haven't had a real issue with it yet.

Thinking about it though, I am not sure either is really needed as their functionality is to close stale connections to allow other users to connect like web pages or Internet services. The 01OS, when ran locally, is only expecting one single connection and ideally would be idle until a request would come in and in my view it would be intermittently. A tried request would error out regardless to alert the user.

Tested on: Debian 11 (aarch64) Python 3.11.19

Resources: https://websockets.readthedocs.io/en/stable/topics/timeouts.html