Repository navigation
control(fix): Qualify borrowed daemons before attachment - #172
Merged
Merged
Conversation
why: The socket path can change after a caller identifies its daemon and before tmux opens its control connection. what: - Pin the socket inode before checking the peer PID and start time. - Pass the pinned path to tmux and disable socket activation on exec.
why: Retiring a control client during startup can stop a borrowed tmux daemon and its sessions on older builds. what: - Check daemon cleanup support before direct, scoped or supervised startup. Allow a verified backport digest for older releases. - Report the observed decision and keep one-shot commands available. - Keep reconnect refusals retryable on the same retired handle and cancel a pending qualification when its last caller leaves. - Exercise refusal, session survival and native client retirement.
why: Operators need to distinguish the one-shot floor from the build requirements for a borrowed control connection. what: - Describe how to qualify an older daemon from its build record. - Document refusal, reconnect and the Linux socket identity check.
why: Callers upgrading an older tmux host need the borrowed-control requirement and the one-shot alternative. what: - Link the borrowed-server qualification guide from the fixed notes.
why: The packed example opened borrowed control even when the daemon reported that it required a backport. what: - Check the one-shot split, caller exit and respawn on every build. - Let the daemon's capability report select the borrowed split. Run it for a verified backport and fail if the supplied digest is wrong. - Print the observed tmux version and the reason for running or skipping the borrowed split.
why: The fixture runs a split in a separate VM. The two calling sites need to show which pane result they read after one-shot execution or scoped control cleanup. what: - Return the pane from the shared split callback and match its ID at each calling site. - Lay out the borrowed server descriptor and connection options in the embedded Elixir example.
why: The tmux client and daemon can report different versions. Reading the client version could skip retirement coverage on a qualified daemon. what: - Ask a private daemon for its borrowed-control capability before selecting the native cases. Keep the refusal test on pristine tmux. - Check a supplied backport digest on the daemon under test and show the qualification decision when a receipt fails. - Preserve filtered unit runs and report uncertain probe cleanup.
tony
added a commit
that referenced
this pull request
Dec 5, 2026
why: The Linux 3.3 retirement check assumes that a borrowed daemon survives control startup. Pristine tmux 3.3 lacks the required fix. what: - Bring in the borrowed-control qualification and test selection from #172. Keep one-shot and refusal coverage on pristine tmux 3.3. - Link the setup instructions to the verified backport guide.
This branch was successfully deployed
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.
Refs #5. This qualification merged into
main. Draft #169 retains a copy along with its pristine tmux 3.3 integration evidence.What changed, and why
A control client that exits during startup can stop an unpatched borrowed tmux daemon and its sessions. Direct opens, scoped opens and supervised starts now check the daemon before attachment. On pristine tmux 3.3 the caller receives
:unsupported_featurewith:no_writeand can still read the session withServer.run/3. Upstream cleanup fixServer.capabilities/2reports the decision. Known upstream releases qualify from tmux 3.7. For an older build, the caller supplies:control_backport_sha256from a verified backport. The library checks the running daemon executable. The Linux helper pins the socket and verifies its peer before starting the client, including on reconnect. A caller can retry a refused reconnect on the same retired handle.Checks run
The full suite ran on Linux arm64 with Elixir 1.20.4 and OTP 29.1.2 using
mix test --include integration --warnings-as-errors.A recording client caught the original attempt to attach on pristine 3.3. The corrected branch also passed socket replacement, supervisor restart and caller cancellation. Earlier full runs hit timing failures in startup, waiter and CLI fixtures. The table gives the successful whole-command reruns. The native pre-ready loss cases are skipped on unqualified builds.
The original packed singleton-argv fixture opened borrowed control unconditionally. It failed on pristine 3.3 in 33.18 s after the one-shot split. It now selects the borrowed split from the answering daemon's
Server.capabilities/2report. The one-shot case always verifies caller exit, respawn and what happens when the retained helper path disappears.16b1f86backport_requiredverified_backportupstream_releaseAll three ran
mix run scripts/check_package.exs --examples. The same command with a wrong digest on the backport failed withdigest_mismatchin 46.65 s. All 156 maintainer script tests passed in 69.49 s. ExDoc built with warnings as errors, and the link checker found 0 broken local references across 79 pages.On
fd9b0fd, the native retirement tests also select from the answering daemon's capability report. A client reporting 3.3 against a 3.8 daemon previously skipped all four pre-ready cases. All four now run and pass in 1.77 s. A wrong backport digest fails all four before attachment in 1.54 s. The unconditional refusal test still exercises direct, scoped and supervised starts and checks the surviving session on pristine 3.3.fd9b0fdAll three used the CI command with two concurrent cases and seed 624498. The 11 additional skips on pristine 3.3 require qualified borrowed control. A dry run and an unrelated module filter made zero tmux calls.
Tool use
Codex implemented the change, ran the Linux fixtures and checked the resulting process and session state. A separate Codex reviewer checked the exact patch against the tested worktrees and build evidence.