forked from dries/ocman
fix(server): handle tmux installed but no server running #2
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "codex/tmux-no-server"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Actual issue encountered
While using ocman to create a new OpenCode session for this repository, the UI failed before it could launch a new session. The failure was visible in the "Failed to start session" dialog:
This was a real session-start failure observed in ocman, not a theoretical cleanup. The important clue was that
tmuxwas installed, but ocman still reported it as unavailable.What we observed while debugging
tmuxbinary exists, then callstmux list-sessions/tmux list-clientsto populate/api/tmux/sessionsand/api/tmux/clients.tmux list-sessionsandtmux list-clientsexit non-zero when the tmux binary is installed but no tmux server/socket exists yet. tmux reports this as variants such asno server running ...orerror connecting to ... (No such file or directory).available: false, so the frontend concluded tmux was unavailable even in the recoverable "installed, but no server yet" state.What we assumed / inferred
available: truewith an empty list, becausetmux new-sessioncan create the server on demand.(Permission denied),(Operation not permitted), or a genericerror connecting to ...still report unavailable so the user gets a real failure instead of a misleading launch attempt.Caveat
This PR only fixes tmux availability reporting for the fresh no-server state. It does not claim that OpenCode itself will start or be discovered correctly after launch; the next PR in the stack handles fresh OpenCode port discovery during tmux launch.
Stack
Stacked on
codex/ignore-local-build-artifacts. Next PR:codex/opencode-fresh-port-discovery.Validation
Run on
codex/tmux-no-server:go test ./internal/server -run 'Test(IsTmuxServerNotRunningError|HandleTmuxStatus|AllTermWindowNames)'go test ./internal/serverThe stack tip was also previously validated with
make test,make lint,make build, andCGO_LDFLAGS="-framework UniformTypeIdentifiers" go build -tags "desktop production" -o ocman-desktop ..4e6ff05c2ato74bbe58a3b74bbe58a3bto1a4d9d70821a4d9d7082to97fa317004Pull request closed