Skip to content

fix: prevent UI freeze when tmux server is dead#444

Open
mr-sk wants to merge 1 commit intoasheshgoplani:mainfrom
mr-sk:fix/tmux-dead-server-hang
Open

fix: prevent UI freeze when tmux server is dead#444
mr-sk wants to merge 1 commit intoasheshgoplani:mainfrom
mr-sk:fix/tmux-dead-server-hang

Conversation

@mr-sk
Copy link
Copy Markdown

@mr-sk mr-sk commented Mar 27, 2026

Summary

  • When the tmux server crashes but leaves a stale socket (/tmp/tmux-*/default), every tmux subprocess call hangs for ~3s before failing. The background status worker makes dozens of these calls per tick across all sessions, causing 30-50s UI freezes.
  • Adds IsServerAlive() health check (1s probe, cached 5s) and short-circuits backgroundStatusUpdate() when the server is unreachable.
  • Adds missing 3s timeouts to GetEnvironment(), SetEnvironment(), RefreshSessionCache(), and RefreshPaneInfoCache() subprocess fallbacks which previously had no timeout.
  • Pins GOTOOLCHAIN=go1.24.0 globally in the Makefile (was only applied to the release-local target).

Test plan

  • go test ./internal/tmux/... passes
  • go test ./internal/ui/... passes (pre-existing TestDialogPresetCommands failure unrelated)
  • Launch agent-deck with a dead tmux server (stale socket) — TUI should remain responsive
  • Launch agent-deck with a healthy tmux server — status updates should work normally
  • Verify make build uses Go 1.24.0 toolchain

🤖 Generated with Claude Code

When the tmux server crashes but leaves a stale socket, every tmux
subprocess call hangs for ~3s before failing. The status worker makes
dozens of these calls per tick across all sessions, causing 30-50s
UI freezes.

Changes:
- Add IsServerAlive() health check with 1s probe cached for 5s
- Short-circuit backgroundStatusUpdate() when tmux server is dead
- Add 3s timeouts to GetEnvironment() and SetEnvironment() (had none)
- Add 3s timeouts to RefreshSessionCache() and RefreshPaneInfoCache()
  subprocess fallbacks (had none)
- Pin GOTOOLCHAIN=go1.24.0 globally in Makefile (was only in
  release-local target)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant