Skip to content

Type Alias: ThreadSession

ThreadSession = object

Session-scoped transcript + stream state for one conversation thread.

abortController: AbortController | null


assistantId: string | null


error: Error | null


feedbackByMessage: Record<string, MessageFeedback>


hasMoreHistory: boolean


historyLoaded: boolean


historyPage: number


optional lastRequestContext?: MastraRequestContextSnapshot

Context snapshot reused when regenerating the last turn.


messages: UIMessage[]


pendingApprovalsByMessage: Record<string, PendingApproval[]>


queuedSteers: SessionQueuedSteer[]

Steers submitted mid-turn, waiting to run (oldest first).


runId: string | null


optional runRequestContext?: MastraRequestContextSnapshot

Context snapshot for the active run and approval continuation.


runs: Record<string, SessionRun>

Live runs retained by id so older approval cards resume their own context.


runToken: number


status: ChatStatus