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
{{ message }}
Repository navigation
[Bug]: starting a second agent-server in the same sandbox kills tmux sessions on the shared openhands socket #2965
When an OpenHands Cloud sandbox already has an agent-server running for the active conversation, starting another agent-server process inside the same sandbox can break the original conversation's terminal tools.
Why this happens
Current agent-server startup calls _cleanup_stale_tmux_sessions() and uses the shared openhands tmux socket (TMUX_SOCKET_NAME = "openhands"). In a shared runtime, the second server treats the first server's live tmux sessions as stale and kills them.
After that, the original conversation starts failing with errors like:
Error executing tool 'terminal': ['no server running on /tmp/tmux-10001/openhands']
Reproduction outline
Start an OpenHands Cloud conversation (or otherwise run one agent-server in a sandbox).
In the same sandbox, start a second agent-server process with default settings.
Use the original conversation's terminal tool.
Observe tmux socket / missing server failures.
Expected behavior
Running another agent-server in the same sandbox should not kill tmux sessions owned by a different live server instance.
Possible fixes
Namespace the tmux socket per server instance or per conversation.
Make tmux cleanup opt-in or scope it to sessions created by the current server instance.
Refuse to start when another live server is already using the shared tmux socket.
Activity