pub struct PostLlmCtx {
pub session_id: SessionId,
pub full_text: String,
pub parse: ParseOutcome,
pub available_tools: Vec<String>,
pub turn_count: u32,
pub total_actions: usize,
pub nudge_count: usize,
pub turn_actions: usize,
pub skip_push: bool,
pub follow_up_message: Option<String>,
pub finish_reason: FinishReason,
}Fields§
§session_id: SessionId§full_text: String§parse: ParseOutcomeThe action backend’s four-state verdict for this turn (M3 seam). The
turn’s action list rides inside ParseOutcome::Actions; middleware
discards pending work with PostLlmCtx::demote_to_text. Tool calls
and CodeAct cells both surface here as Actions — no protocol shape.
available_tools: Vec<String>§turn_count: u32§total_actions: usize§nudge_count: usizeNumber of tool-enforcement nudges issued in the current turn. Read from session; middleware may increment this to track nudge attempts.
turn_actions: usizeNumber of tool calls already executed in the current turn.
Used by TurnToolLimitMiddleware to enforce per-turn tool call limits.
skip_push: bool§follow_up_message: Option<String>§finish_reason: FinishReasonSemantic finish reason from the LLM (Stop / ToolUse / Truncated / Other). Middleware can inspect this to implement custom continuation logic (e.g. auto-continue on truncation).
Implementations§
Source§impl PostLlmCtx
impl PostLlmCtx
Sourcepub fn actions(&self) -> &[Action]
pub fn actions(&self) -> &[Action]
The turn’s pending actions (empty when the turn has none or was demoted).
Sourcepub fn actions_mut(&mut self) -> Option<&mut Vec<Action>>
pub fn actions_mut(&mut self) -> Option<&mut Vec<Action>>
Mutable access to the pending actions (e.g. to drop selected ones).
Sourcepub fn demote_to_text(&mut self)
pub fn demote_to_text(&mut self)
Discard the turn’s pending actions and demote it to text-only. A
demoted turn dispatches exactly like ParseOutcome::Empty (nudge on
empty text, finish-anomaly handling on text).
Sourcepub fn has_action_intent(&self) -> bool
pub fn has_action_intent(&self) -> bool
Whether the backend saw action intent this turn — true for
ParseOutcome::Actions and ParseOutcome::Incomplete (a call the
truncation guard left with zero entries still counts as intent).