pub struct TmuxIdentity {
pub socket: Option<String>,
pub session: String,
pub window_id: String,
pub pane_id: Option<String>,
}Expand description
A fully-qualified tmux window identity recorded at spawn time.
tmux_window (the human name) is not unique across sessions, and a bare
tmux list-windows -a cannot see windows on a non-default socket. This
triple pins the exact window the agent runs in — session:window_id is
unique per server, window_id (the @NNNN form) survives renames, and
socket disambiguates multiple tmux servers. The watchdog matches on this
when present (design.md §8.1).
pane_id (the %NN form) pins the agent’s specific pane within that
window, recorded at spawn. Window-owning operations (kill-window teardown —
the supervisor owns the whole window per the cleanup invariants) key off
window_id; only per-pane operations that must not follow the window’s
active pane — chiefly pipe-pane agent-log capture — use pane_id. It is
None for a run spawned before create.sh emitted the field; capture then
falls back to window_id (issue capture-agent-pane-by-pane-id).
The watchdog’s liveness probe still keys off window_id (correct for the
single-pane autonomous path). A pane-aware liveness probe — needed so a split
interactive window whose agent pane dies while a user shell pane survives is
still seen as dead — is a follow-up (watchdog-pane-aware-liveness), not this
change.
Fields§
§socket: Option<String>Server socket path (#{socket_path}). None if create.sh could not
read it; the watchdog then queries tmux on its default socket.
session: StringSession that owns the window (#{session_name}).
window_id: StringStable window id in @NNNN form (#{window_id}). Survives renames and
is unique within the server.
pane_id: Option<String>Stable pane id in %NN form (#{pane_id}), recorded at spawn — the
agent’s own pane. None for a run whose create.sh predates the field
(back-compat: old state deserializes with pane_id: None). Prefer
TmuxIdentity::capture_target over reading this directly.
Implementations§
Source§impl TmuxIdentity
impl TmuxIdentity
Sourcepub fn capture_target(&self) -> &str
pub fn capture_target(&self) -> &str
The tmux target for a per-pane operation that must hit the agent’s own
pane, not the window’s active pane: the recorded pane_id when
present, else the window_id (which resolves to the active pane).
Used by agent-log capture (pipe-pane). Window-level operations
(kill-window, liveness) must NOT use this — they key off window_id
directly so they act on the whole window.
A recorded pane_id is preferred only when non-empty; an empty string
(a directly-deserialized/corrupt state that the reducer/spawn normalizers
never produce) is treated as absent so capture never targets -t "".
Trait Implementations§
Source§impl Clone for TmuxIdentity
impl Clone for TmuxIdentity
Source§fn clone(&self) -> TmuxIdentity
fn clone(&self) -> TmuxIdentity
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more