pub struct AgentSessionEntry {
pub session_ref: String,
pub short_id: Option<String>,
pub cwd: Option<String>,
pub started_at_ms: Option<i64>,
pub state: Option<String>,
pub pid: Option<i64>,
}Expand description
One session from an agent’s sessions command output: a JSON array of
objects, of which the fields below are read and everything else ignored.
sessionId (falling back to id) is the durable reference substituted
into {session}; cwd and startedAt (ms epoch) identify a fresh
dispatch’s session among its siblings; state and pid together say
whether the session is still going (AgentSessionEntry::liveness).
Fields§
§session_ref: String§short_id: Option<String>§cwd: Option<String>§started_at_ms: Option<i64>§state: Option<String>§pid: Option<i64>The supervisor process behind this session, where the listing names one. Authoritative for liveness when present (DESIGN.md §8), since a listing keeps entries for sessions whose state it never retires.
Implementations§
Source§impl AgentSessionEntry
impl AgentSessionEntry
Sourcepub fn matches_ref(&self, session_ref: &str) -> bool
pub fn matches_ref(&self, session_ref: &str) -> bool
Whether this entry is the session a stored reference points at — either id form matches, since a log-parsed fallback may record the short id.
Sourcepub fn liveness(&self) -> SessionLiveness
pub fn liveness(&self) -> SessionLiveness
Classify this entry’s liveness (DESIGN.md §8). A listing that keeps an
entry forever is the case this exists for: an agent’s own listing may
leave a long-dead session sitting at blocked and never say done, so
not-done cannot mean live. A named pid decides it — which keeps a
genuinely stalled session, blocked on a permission prompt with its
supervisor alive, reading as live and attachable. Failing a pid, only
working claims the session is going; anything else, including a state
this doesn’t recognise or no state at all, reads as dead.
Sourcepub fn at_rest(&self) -> bool
pub fn at_rest(&self) -> bool
Whether this entry says its session’s turn has ended — the narrow
reading the rest rule acts on (DESIGN.md §8), which is not the same
question as liveness. Only done answers yes.
blocked is the case that makes the distinction load-bearing: it reads
dead without a live pid, but it is also what a permission prompt and a
supervisor mid-turn look like, and stopping either would cut a turn off
mid-sentence. Every other state, and an entry with no state at all, is
likewise not a hand-back.
Trait Implementations§
Source§impl Clone for AgentSessionEntry
impl Clone for AgentSessionEntry
Source§fn clone(&self) -> AgentSessionEntry
fn clone(&self) -> AgentSessionEntry
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AgentSessionEntry
impl Debug for AgentSessionEntry
impl Eq for AgentSessionEntry
Source§impl PartialEq for AgentSessionEntry
impl PartialEq for AgentSessionEntry
impl StructuralPartialEq for AgentSessionEntry
Auto Trait Implementations§
impl Freeze for AgentSessionEntry
impl RefUnwindSafe for AgentSessionEntry
impl Send for AgentSessionEntry
impl Sync for AgentSessionEntry
impl Unpin for AgentSessionEntry
impl UnsafeUnpin for AgentSessionEntry
impl UnwindSafe for AgentSessionEntry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.