pub struct PersistedSession {
pub agent_id: String,
pub name: String,
pub messages: usize,
pub created_at: Option<u64>,
pub updated_at: Option<u64>,
}Expand description
A conversation mentra has on disk, as basis reports it.
basis’s own shape rather than a re-export of mentra’s PersistedAgentSummary,
for the same reason Event is basis’s own type: what basis
publishes should not move because a runtime internal did.
Fields§
§agent_id: StringThe persisted agent id, which is also the ACP session id (ADR-0007).
name: StringThe name the session was opened under.
messages: usizeHow many messages the conversation holds. Zero means it was opened and never used.
created_at: Option<u64>When the conversation was first written, in seconds since the epoch.
Optional because mentra’s summary is: a store that keeps nothing
across process lifetimes has no record and therefore no answer, and
basis carries that rather than inventing a number to fill the gap.
Nothing reached through list_in is one of those — listing opens a
file store of its own, whatever the workspace was running on — so in
practice both of these arrive set. list_in’s ordering still handles None, because a
rule that only works for the values it happens to see is not a rule.
updated_at: Option<u64>When it was last written, on the same clock and absent in the same case.
This is last persisted, not last spoken: mentra rewrites an agent’s
row on every turn and on every set_model, set_effort or set_name,
so it moves for a rename as readily as for an exchange. Close enough to
“last activity” to sort a list by, and not close enough to bill by.