Repository navigation
Conversation
tony
force-pushed
the
engine-seam-minimal
branch
from
August 15, 2026 10:36
ed7206c to
18e3d72
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #739 +/- ##
==========================================
- Coverage 61.99% 59.96% -2.03%
==========================================
Files 29 37 +8
Lines 5091 6582 +1491
Branches 1082 1318 +236
==========================================
+ Hits 3156 3947 +791
- Misses 1595 2199 +604
- Partials 340 436 +96 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
tony
force-pushed
the
engine-seam-minimal
branch
2 times, most recently
from
August 15, 2026 12:32
b9deeb2 to
947eaa4
Compare
tony
force-pushed
the
engine-seam-minimal
branch
from
August 23, 2026 00:16
0bcf5b9 to
740526e
Compare
2 of 4 tasks
tony
force-pushed
the
engine-seam-minimal
branch
from
November 7, 2026 02:17
3de1062 to
7cfa475
Compare
tony
force-pushed
the
engine-seam-minimal
branch
from
November 20, 2026 23:10
7cfa475 to
cc024dd
Compare
This was referenced Nov 21, 2026
tony
force-pushed
the
engine-seam-minimal
branch
from
November 21, 2026 16:30
cc024dd to
48ba47c
Compare
4 tasks done
tony
force-pushed
the
engine-seam-minimal
branch
from
November 21, 2026 17:11
48ba47c to
08fd87a
Compare
tony
force-pushed
the
engine-seam-minimal
branch
4 times, most recently
from
November 22, 2026 20:12
909b8de to
240da60
Compare
7 of 20 tasks
This was referenced Nov 24, 2026
This was referenced Dec 3, 2026
tony
force-pushed
the
engine-seam-minimal
branch
from
December 4, 2026 03:13
c8717d3 to
ebde4a6
Compare
This was referenced Dec 4, 2026
why: Raw-byte engines need shared imsg ceiling checks, trailing semicolon escaping, generation fences, and control-mode guard parsing. what: - Add transport, timeout, command-length, restart, and mismatch errors to libtmux.exc - Add invocation packing, trailing semicolon escaping, and command-chain splitting in libtmux._internal.invocation - Add if-shell -F generation fences in libtmux._internal.daemon_guard - Add ServerConnection, structural capability protocols, and flags-aware ControlModeParser
why: Exposing a minimal raw-byte TmuxEngine protocol allows swapping transports, streaming binary stdin/stdout, and testing without tmux. what: - Add libtmux.engine with TmuxEngine, AsyncTmuxEngine, TmuxRequest, TmuxResult, DaemonGuard, SubprocessEngine, ControlModeEngine, and ExecEngine - Add batch-delegating InstrumentedEngine and CountingSink in libtmux._internal.instrumentation - Add FakeEngine and RecordingEngine in libtmux.test
why: Gated tmux features and connected daemon identity checks should read one declarative table and publish capabilities.json. what: - Add libtmux._internal.support.capabilities with shared port capability and workaround entries, release ordering, and hook-free daemon probing - Add public libtmux.capabilities (Capability, ServerCapabilities, Workaround) - Generate capabilities.json via just build-capabilities
why: Classic Server, Session, Window, Pane, neo, and tmux_cmd callers should execute over any TmuxEngine without losing raw bytes or UTF-8 format separators under C locales. what: - Route tmux_cmd through TmuxEngine, exposing raw_stdout and raw_stderr alongside decoded stdout and stderr lines - Add Server(..., engine=...), Server.capabilities(), Server.kill(wait=) and endpoint-aware Server.__eq__ - Route version gates through capability_since(), drop sub-floor hook gates, strip $TMUX per invocation, and gate retired 3.9 popup options
why: Later transport changes need a baseline benchmark that separates request count from inline tmux command count on an isolated server. what: - Add scripts/bench/primitives.py and scripts/bench/current_api.py over libtmux.engine and CountingSink - Cover PEP 723 script source pins, scratch reaper safety, and benchmark accounting under tests/scripts/
why: Engine behavior and public examples need coverage through the same entry points used by custom engines and classic Server callers. what: - Exercise engine dispatch, capability rules, and session environments. - Document engine selection, daemon capabilities, and the public API.
why: Reconcile the engine seam with v0.70.0 timeout reaping, single-owner command logging, and strict ty plus Ruff ANN static type checking. what: - Slice communicate waits and close pipes without draining on timeout or BaseException in SubprocessEngine and ClientProcess - Propagate TmuxCommandTimeout from ControlModeEngine without fallback replay and preserve OS launch diagnostics in TmuxCommandNotFound - Keep tmux_cmd as the sole command-log producer and avoid duplicating os.environ when probing named sockets - Type ServerConnectionTarget, Sink[_StateT], InstrumentedEngine, RecordingEngine, guard_sync_call, and benchmark reports without Any or type-ignore comments
why: Moving command execution to a byte transport exposed carriage returns in the classic stdout and stderr lists. what: - Normalize CRLF and lone CR in the decoded view of each stream. - Keep the exact bytes available to callers that parse native replies. - Exercise both command entry points and custom result objects.
why: A lost control reply leaves delivery uncertain. Retrying submitted commands can apply a state change twice. what: - Keep subprocess fallback inside the connection setup phase. - Propagate a transport failure while sending or collecting replies. - Count real single and batched mutations after a simulated reply loss.
why: Session creation removes TMUX from the child environment. Applying that complete snapshot as an overlay reintroduced the parent value. what: - Pass the cleaned environment as the entire subprocess environment. - Verify the new daemon retains unrelated variables and excludes TMUX.
why: A classic command may use native tmux syntax. Repacking its arguments as structured values changed what tmux received. what: - Keep native argument vectors alongside structured command inspection. - Use the same command rendering and size checks for CLI transports. - Route unsupported control-mode requests before dispatch.
why: An interrupted reply can stay unread on a persistent client. Reusing it can return the previous command's output to the next caller. what: - Detach the client under the dispatch lock on an interrupted exchange. - Reap the abandoned process and propagate the original exception. - Check distinct replies after single-command and batch interruptions.
why: A named socket resolves under the client environment. Checking it under the parent environment could reject a valid requested address. what: - Resolve socket limits with the same environment supplied to tmux. - Keep connection construction separate from per-call validation. - Check both directions of named-socket environment replacement.
why: A structured request supplies data separately from command boundaries. A quoting character in a data value must reach tmux. what: - Encode each structured argument once at the invocation boundary. - Keep native argument vectors and format markers intact. - Document which output the tmux control protocol provides.
why: Cloning a persistent transport during server configuration left its control client attached after the caller closed the original engine. what: - Require callers to bind a persistent connection before injecting it. - Preserve that lifetime rule when a recording engine wraps the client. - Compare effective injected socket selectors when comparing servers.
why: A fixture may select its isolated daemon by socket path or label. Native comparisons must query the same daemon as the public session. what: - Forward the fixture connection's client flags and executable to tmux_cmd.
why: A request can override an engine's socket or the process environment. Checking the server defaults before rendering can reject a reachable daemon or let an oversized address through. what: - Resolve native client selectors with the same environment and working directory used to launch tmux. - Validate classic calls at their local transport boundary and retain native status for low-level requests. - Apply the same address rules when opening a control client and exercise overridden selectors with a private daemon.
why: An injected subprocess engine can own the only socket selector. Building a persistent client from the server's constructor flags then addresses the ambient daemon. what: - Preserve the selected local engine connection in the control client factory. - Exercise the native socket, attached control client count, and cleanup through public entry points.
why: Deadlines and interrupts must reap the actual tmux client and close its pipes. A test double that copies subprocess options rejects valid launches when the runner supplies its socket environment. what: - Observe real processes and preserve their launch environment in the readiness handshake. - Use real server and session objects to exercise log escaping. - Retain the PID, signal, closed pipe and surviving server assertions.
why: Version detection and the standalone control client have their own launch paths. Callers choosing a test engine need to know which operations it can intercept. what: - Describe engine dispatch at Server.cmd and its object-method callers.
…elpers why: Callers running tmux inside containers, pods, remote SSH hosts, or sandboxes need ready-made transport prefixes, remote shell quoting for space-joining transports like ssh, and remote tmux -V probing (#841). what: - Add ExecEngine.docker(), ExecEngine.ssh(shell=True), ExecEngine.kubectl(), ExecEngine.sandbox(), shell= shlex.join quoting, and cached tmux_version() probing - Exercise docker, ssh, kubectl, and sandbox shims with awkward quoting and binary stdin payloads
why: Callers selecting a command transport need its byte, process, delivery, and remote wrapper contracts recorded in the changelog. what: - Describe decoded lines, native bytes, binary subprocess pipes, and ExecEngine transport wrappers - Document connection fallback and uncertain completion after dispatch
tony
force-pushed
the
engine-seam-minimal
branch
from
December 5, 2026 16:52
ebde4a6 to
0269c6c
Compare
This branch has not been 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.
Note
Rebase alignment with
v0.70.0(0.74.0milestone, #907):libtmux._internal.support.capabilities(#887,0.65.0),Server(..., kill_on_exit=True)(#728,0.69.0), structured logging and symmetric environment masking (#748,0.70.0),exc.TmuxCommandTimeoutwith pipe-safe child reaping (#807,0.70.0), andty+ RuffANN(#682,0.70.0) are now onmaster. Rebase aligns_run_popen_requestandControlModeEnginetimeout non-replay with #807 and unifies public capability reporting (#871, #925).Summary
libtmuxthrough a pluggable raw-bytelibtmux.engineseam (TmuxEngine,AsyncTmuxEngine,TmuxRequest,TmuxResult,DaemonGuard,SubprocessEngine,ControlModeEngine,ExecEngine) while keepingServer.cmd()(tmux_cmd) and theServer→Session→Window→Panehierarchy unchanged under the default transport.ExecEngine.docker(),ExecEngine.ssh(),ExecEngine.kubectl(), andExecEngine.sandbox()withshell=Trueremote shell quoting and cached remotetmux -Vprobing.libtmux.capabilities(Capability,ServerCapabilities,Workaround) andServer.capabilities(), backed by the shared capability table inlibtmux._internal.support.capabilitiesand published incapabilities.json(just build-capabilities).FakeEngineandRecordingEngineinlibtmux.testfor offline and pass-through command verification without patchingsubprocess.Closes #841.
Changes
Engine seam (
libtmux.engine&libtmux._internal)TmuxRequestcarries native argv or structured command tuples, client flags, stdin, deadlines, and environment overrides. A subprocess result exposes separate exact byte streams. The classic stdout and stderr lists recognize CRLF and lone CR as line breaks.SubprocessEngine: Default binary-mode CLI transport with bounded timeouts andspawn_client()handles.ExecEngine: Prepends wrapper prefixes (docker exec,ssh,kubectl exec, sandbox wrappers) withshell=Trueremote shell quoting onssh, remotetmux -Vprobing (tmux_version()), and distinctendpointidentity reflected inServer.__eq__.ControlModeEnginepipelines eligible commands on tmux 3.7 and newer. It can choose a subprocess before dispatch. An interruption after dispatch retires the client and propagates to the caller. A control frame has one payload and a success or error status. Use the subprocess engine for independent stdout and stderr.Server.cmd()preserves native argv. Structured requests preserve literal data.new_session()starts its client with a cleaned environment.ControlModeEngine.for_server()binds a persistent client to an explicit endpoint and gives the caller its cleanup handle.Capabilities (
libtmux.capabilities&capabilities.json)Server.run_shell,Server.list_keys,Pane.capture_pane,Pane.paste_buffer,Pane.new_pane,ControlModeEngine), retiredtmux 3.9popup window options (#878), andPane.break_pane's3.7repair workaround inlibtmux._internal.support.capabilities, matching#887'sjust build-capabilitiesmanifest workflow.Server.capabilities()via-u -N run-shell -Cso neither a stopped server is started nor anyafter-*hook fires.Test plan
ExecEngineshim tests coverdocker exec,ssh(shell=Truevsshell=Falseawkward quoting),kubectl exec, and sandbox wrappers, binarystdintransfers, and remotetmux -Vprobing.3.11and3.15)pytestsuite across supported tmux releasesjust build-docs)The subprocess result covers the raw output portion of #881.