mirror of
https://github.com/OpenHands/OpenHands.git
synced 2025-12-26 05:48:36 +08:00
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: openhands <openhands@all-hands.dev> Co-authored-by: Graham Neubig <neubig@gmail.com> Co-authored-by: llamantino <213239228+llamantino@users.noreply.github.com> Co-authored-by: mamoodi <mamoodiha@gmail.com> Co-authored-by: Tim O'Farrell <tofarr@gmail.com> Co-authored-by: Hiep Le <69354317+hieptl@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Ryan H. Tran <descience.thh10@gmail.com> Co-authored-by: Neeraj Panwar <49247372+npneeraj@users.noreply.github.com> Co-authored-by: sp.wack <83104063+amanape@users.noreply.github.com> Co-authored-by: Insop <1240382+insop@users.noreply.github.com> Co-authored-by: test <test@test.com> Co-authored-by: Engel Nyst <enyst@users.noreply.github.com> Co-authored-by: Zhonghao Jiang <zhonghao.J@outlook.com> Co-authored-by: Ray Myers <ray.myers@gmail.com>
Session Management
Socket.io is used as the underlying protocol for client server communication. This allows the event handlers in the code to be somewhat separate from the connection management - so brief connection interruptions are recoverable.
There are 3 main server side event handlers:
connect- Invoked when a new connection to the server is established. (This may be via http or WebSocket)oh_user_action- Invoked when a connected client sends an event (such as a prompt for the Agent) - this is distinct from theoh_eventsent from the server to the client.disconnect- Invoked when a connected client disconnects from the server.
Disconnect
The (manager)[manager.py] manages connections and sessions. Each session may have zero or more connections
associated with it. When a session no longer has any
connections associated with it, after a set amount of time (determined by config.sandbox.close_delay),
the session and runtime are passivated (So will need to be rehydrated to continue.)