mirror of
https://github.com/OpenHands/OpenHands.git
synced 2026-10-07 15:28:34 +08:00
dev-safe.mjs put the tmux socket dir at os.tmpdir(). On macOS that is the per-user $TMPDIR (/var/folders/.../T), which the OS periodically reaps (com.apple.bsd.dirhelper deletes entries untouched for a few days). The reaper deletes the live tmux socket while the tmux server keeps running, orphaning it, so every later new-window fails with: LibTmuxException: new-window: error connecting to .../openhands-agent-canvas-tmux/tmux-501/openhands (No such file or directory) #325 moved the socket dir to os.tmpdir() to dodge a Unix-domain-socket failure on mounted volumes, but its intent (per the commit message) was literally /tmp -- os.tmpdir() != /tmp on macOS, and the per-user temp dir is exactly what gets reaped. Default to <stateDir>/tmux (~/.openhands/agent-canvas/tmux) instead, matching where the rest of dev state already lives: persistent, on local disk, and never reaped mid-session. dev-safe.mjs only ever runs on the host (the container launches openhands-agent-server directly, never this script), so the socket dir is always under a normal local home there. For the rare host whose $HOME is on a socket-incompatible mount (devcontainers, NFS/CIFS homes) -- the case #325 cared about -- honor the standard TMUX_TMPDIR env var (which we already pass through to the agent-server's tmux) so it can be pointed at a local path like /tmp. No new project-specific env var needed. Co-authored-by: openhands <openhands@all-hands.dev> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>