pub struct SessionState {Show 13 fields
pub name: String,
pub backend_type: String,
pub prompt: String,
pub model: Option<String>,
pub cwd: Option<PathBuf>,
pub max_turns: Option<i32>,
pub allowed_tools: Vec<String>,
pub permission_mode: Option<String>,
pub reasoning_effort: Option<String>,
pub env: HashMap<String, String>,
pub memory_config: Option<MemoryConfig>,
pub metadata: HashMap<String, String>,
pub created_at: DateTime<Utc>,
}Expand description
Persisted state for a single agent session.
Stored at ~/.claude/teams/{team}/sessions/{agent}.json and used to
re-spawn agents with the same configuration after an orchestrator restart.
Fields§
§name: StringAgent name.
backend_type: StringBackend type string (e.g. “claude-code”, “codex”, “gemini-cli”).
prompt: StringThe prompt / system instruction.
model: Option<String>Model override (if any).
cwd: Option<PathBuf>Working directory.
max_turns: Option<i32>Max turns.
allowed_tools: Vec<String>Allowed tools.
permission_mode: Option<String>Permission mode.
reasoning_effort: Option<String>Reasoning effort.
env: HashMap<String, String>Extra environment variables.
memory_config: Option<MemoryConfig>Memory configuration for cross-turn context injection.
metadata: HashMap<String, String>Backend-specific metadata (e.g. Codex thread ID for informational purposes).
created_at: DateTime<Utc>Timestamp when the session was created.
Implementations§
Source§impl SessionState
impl SessionState
Sourcepub fn from_config(config: &SpawnConfig, backend_type: &BackendType) -> Self
pub fn from_config(config: &SpawnConfig, backend_type: &BackendType) -> Self
Create a new session state from a spawn config and backend type.
Sourcepub fn to_spawn_config(&self) -> SpawnConfig
pub fn to_spawn_config(&self) -> SpawnConfig
Convert back to a SpawnConfig for re-spawning.
Sourcepub fn parse_backend_type(&self) -> Option<BackendType>
pub fn parse_backend_type(&self) -> Option<BackendType>
Parse the backend type string back to a BackendType enum.
Uses BackendType::from_str() so this stays in sync with Display.
Trait Implementations§
Source§impl Clone for SessionState
impl Clone for SessionState
Source§fn clone(&self) -> SessionState
fn clone(&self) -> SessionState
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SessionState
impl Debug for SessionState
Source§impl<'de> Deserialize<'de> for SessionState
impl<'de> Deserialize<'de> for SessionState
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for SessionState
impl RefUnwindSafe for SessionState
impl Send for SessionState
impl Sync for SessionState
impl Unpin for SessionState
impl UnwindSafe for SessionState
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> 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