pub struct SessionData {
pub project_name: String,
pub metadata: SessionMetadata,
pub run: Option<RunState>,
pub progress: Option<RunProgress>,
pub load_error: Option<String>,
pub is_main_session: bool,
pub is_stale: bool,
pub live_output: Option<LiveState>,
pub cached_user_stories: Option<Vec<UserStory>>,
}Expand description
Data for a single session in the Active Runs view.
This struct represents one running session, which can be from the main repo or a worktree. Multiple sessions can belong to the same project (when using worktree mode).
Fields§
§project_name: StringProject name (e.g., “autom8”).
metadata: SessionMetadataSession metadata (includes session_id, worktree_path, branch).
run: Option<RunState>The active run state for this session.
progress: Option<RunProgress>Progress through the spec (loaded from spec file).
load_error: Option<String>Error message if state file is corrupted or unreadable.
is_main_session: boolWhether this is the main repo session (vs. a worktree).
is_stale: boolWhether this session is stale (worktree was deleted).
live_output: Option<LiveState>Live output state for streaming Claude output (from live.json).
cached_user_stories: Option<Vec<UserStory>>Cached user stories from the spec (to avoid file I/O on every render frame).
This is populated during load_sessions() and should be used by load_story_items().
Implementations§
Source§impl SessionData
impl SessionData
Sourcepub fn display_title(&self) -> String
pub fn display_title(&self) -> String
Format the display title for this session. Returns “project-name (main)” or “project-name (abc12345)”.
Sourcepub fn has_fresh_heartbeat(&self) -> bool
pub fn has_fresh_heartbeat(&self) -> bool
Check if this session has a fresh heartbeat (run is actively progressing).
A session is considered “alive” if:
- It has live output data AND
- The heartbeat is recent (< 10 seconds old)
This is the authoritative check for whether a run is actively progressing.
The GUI/TUI should use this to determine if a run is truly active,
rather than just checking is_running from metadata.
Sourcepub fn is_actively_running(&self) -> bool
pub fn is_actively_running(&self) -> bool
Check if this session should be considered actively running.
A session is actively running if:
- It’s not stale (worktree exists) AND
- It’s marked as running AND
- It either has a fresh heartbeat OR there’s no live data yet (run just started)
This provides a lenient check that accounts for runs that just started and haven’t written live.json yet.
Sourcepub fn appears_stuck(&self) -> bool
pub fn appears_stuck(&self) -> bool
Check if this session appears to be stuck (marked as running but heartbeat is stale).
This helps identify crashed or stuck runs that need user intervention. Returns true if:
- Session is marked as running AND
- Live output exists AND
- Heartbeat is stale (> 10 seconds old)
Sourcepub fn truncated_worktree_path(&self) -> String
pub fn truncated_worktree_path(&self) -> String
Get a truncated worktree path for display (last 2 components).
Trait Implementations§
Source§impl Clone for SessionData
impl Clone for SessionData
Source§fn clone(&self) -> SessionData
fn clone(&self) -> SessionData
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for SessionData
impl RefUnwindSafe for SessionData
impl Send for SessionData
impl Sync for SessionData
impl Unpin for SessionData
impl UnwindSafe for SessionData
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more