You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some cloud sandbox tunnels do not forward WebSocket ping/pong frames. Modal's encrypted tunnel is one: with the default ping_interval, the client never receives a pong and closes the connection on the keepalive timeout. This surfaced in #821 (ModalProvider), where the only working E2E required monkeypatching:
This is a core limitation, not a provider bug: the provider returns a valid https/wssbase_url and has no hook into how EnvClient opens its socket. It also conflicts with the cloud-provider contract in RFC 002 (the returned base_url should work with a stock EnvClient).
Proposed change
Make the WebSocket keepalive configurable on EnvClient (e.g. ping_interval / ping_timeout constructor args, forwarded to ws_connect), so sandbox services whose tunnels drop ping/pong work without monkeypatching. Open questions:
Sensible default: keep the current keepalive, or relax it for robustness across tunnels?
Whether a ContainerProvider should be able to hint a value (e.g. Modal returning ping_interval=None) so users do not have to know the tunnel quirk.
Context
Raised in Add ModalProvider(ContainerProvider) #821 (review) by @burtenshaw: "Make Modal work through stock EnvClient ... lmk if we should make changes in core to facilitate sandbox services without the ws ping route."
Unblocks merging Modal and other tunnel-backed providers without the client-side workaround.
Problem
EnvClientopens its WebSocket with thewebsocketslibrary defaults, which send keepalive pings (~every 20s) and expect pongs:https://github.com/huggingface/OpenEnv/blob/main/src/openenv/core/env_client.py#L214
Some cloud sandbox tunnels do not forward WebSocket ping/pong frames. Modal's encrypted tunnel is one: with the default
ping_interval, the client never receives a pong and closes the connection on the keepalive timeout. This surfaced in #821 (ModalProvider), where the only working E2E required monkeypatching:This is a
corelimitation, not a provider bug: the provider returns a validhttps/wssbase_urland has no hook into howEnvClientopens its socket. It also conflicts with the cloud-provider contract in RFC 002 (the returnedbase_urlshould work with a stockEnvClient).Proposed change
Make the WebSocket keepalive configurable on
EnvClient(e.g.ping_interval/ping_timeoutconstructor args, forwarded tows_connect), so sandbox services whose tunnels drop ping/pong work without monkeypatching. Open questions:ContainerProvidershould be able to hint a value (e.g. Modal returningping_interval=None) so users do not have to know the tunnel quirk.Context
EnvClient... lmk if we should make changes incoreto facilitate sandbox services without the ws ping route."