pub struct SessionRecord {Show 19 fields
pub id: String,
pub provider: Provider,
pub provider_session_id: String,
pub title: Option<String>,
pub summary: Option<String>,
pub cwd: Option<String>,
pub repo_root: Option<String>,
pub created_at: Option<DateTime<Utc>>,
pub updated_at: Option<DateTime<Utc>>,
pub last_message_at: Option<DateTime<Utc>>,
pub preview_text: String,
pub source_path: String,
pub message_count: Option<i64>,
pub parse_version: String,
pub raw_metadata_json: Option<String>,
pub parse_warning: Option<String>,
pub discovery_source: String,
pub parent_session_id: Option<String>,
pub agent_label: Option<String>,
}Fields§
§id: String§provider: Provider§provider_session_id: String§title: Option<String>§summary: Option<String>§cwd: Option<String>§repo_root: Option<String>§created_at: Option<DateTime<Utc>>§updated_at: Option<DateTime<Utc>>§last_message_at: Option<DateTime<Utc>>§preview_text: String§source_path: String§message_count: Option<i64>§parse_version: String§raw_metadata_json: Option<String>§parse_warning: Option<String>§discovery_source: String§parent_session_id: Option<String>The SessionRecord::id of the session that spawned this one, when this session is a
subagent run.
None for an ordinary top-level session. Every provider marks subagent runs
differently (claude by a subagents directory under its parent, codex in a
thread_spawn payload, cursor and pi by directory layout), so detection stays
provider-specific while this field is the one shape they all produce. Typed rather than
buried in raw_metadata_json so “every subagent of this session” is a query, which is
what made codex’s richer spawn data unusable.
Holds the whole id, provider prefix included, so it reads as the same value the parent
row carries in id and needs no rule about stripping a prefix before comparing.
PATTERN: this names a row that need not exist. Providers keep a spawned run’s transcript
after the parent conversation is rotated away — in one project directory, 549 runs
referenced 69 distinct parents and not one of those parent transcripts was still on
disk. Recovering exactly that otherwise-unreachable work is a reason this is indexed, so
do NOT add references sessions(id) to this column: the constraint would reject every
such run at insert, and a cascade would delete the runs when a parent is reindexed away.
agent_label: Option<String>Human-meaningful name for the spawned agent when the provider records one: claude’s
agentType (Explore, general-purpose), codex’s agent_nickname, or the agent’s
own directory or file name where that is all a provider records. Display and grouping
only; the link is parent_session_id.
Trait Implementations§
Source§impl Clone for SessionRecord
impl Clone for SessionRecord
Source§impl Debug for SessionRecord
impl Debug for SessionRecord
Source§impl<'de> Deserialize<'de> for SessionRecord
impl<'de> Deserialize<'de> for SessionRecord
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>,
Source§impl Row for SessionRecord
impl Row for SessionRecord
Auto Trait Implementations§
impl Freeze for SessionRecord
impl RefUnwindSafe for SessionRecord
impl Send for SessionRecord
impl Sync for SessionRecord
impl Unpin for SessionRecord
impl UnsafeUnpin for SessionRecord
impl UnwindSafe for SessionRecord
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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