pub struct SessionHeader {
pub session_id: Option<SessionId>,
pub model: Option<CurrentModel>,
pub effort: EffortLevel,
pub permission_mode: Option<PermissionMode>,
pub context: ContextUsage,
pub available_models: Vec<AvailableModel>,
pub turn_in_flight: bool,
}Expand description
What a session header states about the session.
Fields§
§session_id: Option<SessionId>The occupant’s id, as the CLI named it, or None when there is no
occupant to name: a seat nothing has started, one whose CLI has not
answered yet, and one whose id was dropped after a background sign-in
or connection failure all read the same.
Carried here rather than read off the conversation’s frames, because a
client attaching to a running seat hears no Connected - a
subscription carries no backlog - and a frame’s id is the turn’s fact
rather than the seat’s. The worker registry carries the id for a live
dynamic worker, and nothing carries it for any other seat.
model: Option<CurrentModel>The model the CLI resolved for this session, from its connect and from every later frame that names a different one.
effort: EffortLevelThe effort the session runs at: the hook-observed level when the
session has reported one, else the level its launch stamped, else
forge’s default. Always a value rather than an Option, because
a session that has not used a tool yet still runs at some level
and a header that showed nothing there would be wrong.
permission_mode: Option<PermissionMode>The permission mode the session runs in: the hook-observed mode
when one has fired, else the level its launch stamped, which forge
always writes from its own effective default. None only when the
launch pinned nothing and no hook has reported, which is a session
nothing has started.
context: ContextUsageHow full the context window is, from the bridge’s last answer.
available_models: Vec<AvailableModel>The model catalogue the session’s connect resolved against, which a picker draws its rows from. Empty for a session nothing has started.
turn_in_flight: boolWhether a turn is in flight, from the core’s own OR of the stamped signal and the wire-lagged one: the two disagree in the window between a prompt being routed and its echo arriving, so a read of either alone is wrong for one of them.
Auto Trait Implementations§
impl Freeze for SessionHeader
impl RefUnwindSafe for SessionHeader
impl Send for SessionHeader
impl Sync for SessionHeader
impl Unpin for SessionHeader
impl UnsafeUnpin for SessionHeader
impl UnwindSafe for SessionHeader
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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