Fix tmux socket name length exceeding filesystem limits#204
Open
Zeko369 wants to merge 1 commit into
Open
Conversation
Long project or branch names could push the tmux socket path past the unix socket sun_path limit (104 bytes on macOS), causing 'File name too long' errors on start. The session portion of the instance ID is now truncated to fit a budget derived from the actual tmux socket directory (mirroring tmux's $TMUX_TMPDIR / /tmp + tmux-<uid> logic, symlinks resolved), so it adapts to any uid or TMUX_TMPDIR instead of a fixed cap. Also clean up the command-center socket on a fatal exit: utils.Fatal calls os.Exit, which skips deferred cleanup and orphaned .overmind.sock when startup failed. Fatal now runs registered cleanup functions first. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
a52008a to
904c659
Compare
Zeko369
added a commit
to Zeko369/overmind
that referenced
this pull request
Jun 17, 2026
Fork-only. Lets mise install the patched binary via github:Zeko369/overmind without modifying the module path. Not part of DarthSim#204. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When a project or branch name is long, the tmux socket path can exceed the unix-domain socket
sun_pathlimit (104 bytes on macOS, 108 on Linux), soovermind startfails withFile name too longand never starts tmux:The socket name is the instance ID (
overmind-<session>-<nanoid>), which tmux places under<tmux-tmpdir>/. With a 55-char session that path is 108 bytes — over the macOS limit.Changes
1. Truncate the session to fit the actual socket-path budget. Rather than a fixed cap, the session portion of the instance ID is truncated to whatever room is left after accounting for the real tmux socket directory (
$TMUX_TMPDIRor/tmp, plustmux-<uid>, symlinks resolved) and the-<nanoid>suffix. This adapts to any uid length or customTMUX_TMPDIRinstead of assuming a particular environment; uniqueness is still guaranteed by the nanoid.2. Clean up the command-center socket on a fatal exit.
utils.Fatalcallsos.Exit, which skips deferred cleanup — so when startup failed (e.g. the error above),.overmind.sockwas left orphaned and the next run reported that overmind was "already running."Fatalnow runs registered cleanup functions first, and the command center registers its socket teardown.(These are two small, related startup-robustness fixes — happy to split them into separate PRs if you'd prefer.)
Testing
overmind startruns..overmind.sockis removed on exit (previously leaked).gofmt/go vetclean;go buildpasses.