Skip to main content

AssistantSessionRecord

Struct AssistantSessionRecord 

Source
pub struct AssistantSessionRecord {
    pub session_id: AssistantSessionId,
    pub subject: String,
    pub harness: String,
    pub account: Option<String>,
    pub title: Option<String>,
    pub created_at: DateTime<Utc>,
    pub updated_at: DateTime<Utc>,
    pub turns: u64,
    pub mcp_token_digest: Option<String>,
    pub commands: Vec<AssistantCommand>,
    pub config_options: Vec<AssistantConfigOption>,
}
Expand description

One durable assistant session.

Fields§

§session_id: AssistantSessionId

The session’s identity (primary key).

§subject: String

The caller subject that owns it. The list surface is per caller, so this is the field it filters on — never a namespace, because a session is not a workflow and lives in no namespace.

§harness: String

The configured harness name it runs.

§account: Option<String>

The configured account name, when the harness declares any.

§title: Option<String>

The first 80 characters of the first prompt; None before one.

§created_at: DateTime<Utc>

When the session was created.

§updated_at: DateTime<Utc>

The last time anything about it changed.

§turns: u64

How many turns have been submitted on it — bookkeeping the server keeps in step with the transcript projection, so a listing does not have to read every session’s whole transcript to count them.

§mcp_token_digest: Option<String>

The SHA-256 digest, lowercase hex, of the session-scoped bearer this session’s harness carries to the server’s own MCP endpoint. None when the session was given no aion MCP server.

The digest, never the token: a store that held the token would be a store that could hand it out. Verification hashes what the caller presented and compares. Its LIFETIME is the session’s — a call is admitted only while the session’s projected lifecycle is not ended, so revocation is a durable fact rather than an in-memory set that dies with the process that minted it.

§commands: Vec<AssistantCommand>

The commands the harness advertised most recently.

A DERIVED CACHE of the transcript’s latest aion_core::AssistantSessionEvent::AvailableCommands record, kept for exactly the reason turns and title are: a listing must not read every session’s whole conversation to answer one field, and an advertisement can arrive at the first turn of a conversation that runs for hours, so a bounded tail read cannot find it.

The TRANSCRIPT is the authority. The frame is appended first and this is written from it inside the same append path, so the two cannot be written out of order; the_records_command_cache_is_what_the_transcript_projects pins that a rebuild from the transcript reproduces this field exactly. Unlike a status, this is not a second ANSWER to a question the transcript answers differently — it is the same answer, kept where a listing can afford to read it.

§config_options: Vec<AssistantConfigOption>

The configuration options the harness advertised most recently — the model picker among them. The same derived cache as commands, kept for the same listing-cost reason, with the transcript’s aion_core::AssistantSessionEvent::ConfigOptions records as the authority. #[serde(default)] because records written before options existed decode as having none advertised, which is exactly true.

Implementations§

Source§

impl AssistantSessionRecord

Source

pub fn encode(&self) -> Result<Vec<u8>, StoreError>

Encode the stable backend-neutral representation.

§Errors

StoreError::Serialization when serialization fails.

Source

pub fn decode(bytes: &[u8]) -> Result<Self, StoreError>

Decode and re-validate a stored representation.

§Errors

StoreError::Serialization for malformed bytes or an unknown field.

Source

pub fn summary( &self, state: AssistantSessionState, reason: Option<String>, ) -> AssistantSessionSummary

The listing row for this record under a state the caller has projected.

The state, its lifecycle and its cause are PARAMETERS because none of them is stored: they are read off the session’s transcript records plus whether a process is running (see aion_core::AssistantSessionProjection). A record that carried its own status would be a second answer to a question the transcript already answers, and the two would drift.

Trait Implementations§

Source§

impl Clone for AssistantSessionRecord

Source§

fn clone(&self) -> AssistantSessionRecord

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AssistantSessionRecord

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for AssistantSessionRecord

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for AssistantSessionRecord

Source§

impl PartialEq for AssistantSessionRecord

Source§

fn eq(&self, other: &AssistantSessionRecord) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for AssistantSessionRecord

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for AssistantSessionRecord

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more