pub struct InteractiveSession {
pub session_id: Uuid,
pub goal_id: Uuid,
pub channel_id: String,
pub agent_id: String,
pub state: InteractiveSessionState,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
pub messages: Vec<SessionMessage>,
pub draft_ids: Vec<Uuid>,
}Expand description
A persistent interactive session record linking a goal to channel state.
Tracks the lifecycle of a human-agent interactive session across CLI invocations. Serialized to JSON for persistence (same pattern as ReviewSession).
Fields§
§session_id: UuidUnique session identifier.
goal_id: UuidThe GoalRun this session is attached to.
channel_id: StringChannel identity (e.g., “cli:tty0”).
agent_id: StringAgent identity (e.g., “claude-code”).
state: InteractiveSessionStateSession lifecycle state.
created_at: DateTime<Utc>Session creation time.
updated_at: DateTime<Utc>Last activity time.
messages: Vec<SessionMessage>Message log (persisted for audit and resume).
draft_ids: Vec<Uuid>Associated draft IDs (drafts reviewed inline during this session).
Implementations§
Source§impl InteractiveSession
impl InteractiveSession
Sourcepub fn new(goal_id: Uuid, channel_id: String, agent_id: String) -> Self
pub fn new(goal_id: Uuid, channel_id: String, agent_id: String) -> Self
Create a new interactive session for a goal.
Sourcepub fn log_message(&mut self, sender: &str, content: &str)
pub fn log_message(&mut self, sender: &str, content: &str)
Record a message in the session log.
Sourcepub fn add_draft(&mut self, draft_id: Uuid)
pub fn add_draft(&mut self, draft_id: Uuid)
Record that a draft was reviewed inline during this session.
Sourcepub fn transition(
&mut self,
new_state: InteractiveSessionState,
) -> Result<(), SessionChannelError>
pub fn transition( &mut self, new_state: InteractiveSessionState, ) -> Result<(), SessionChannelError>
Transition to a new state.
Sourcepub fn is_alive(&self) -> bool
pub fn is_alive(&self) -> bool
Check if the session is in an active or paused state (can still be used).
Sourcepub fn elapsed_display(&self) -> String
pub fn elapsed_display(&self) -> String
Format elapsed time as a human-readable string.
Trait Implementations§
Source§impl Clone for InteractiveSession
impl Clone for InteractiveSession
Source§fn clone(&self) -> InteractiveSession
fn clone(&self) -> InteractiveSession
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more