Tool Loop Agent State
data class ToolLoopAgentState(val messages: List<ModelMessage> = emptyList(), val streamingAssistantText: String = "", val currentToolCalls: List<ContentPart.ToolCall> = emptyList(), val pendingApprovals: List<PendingApproval> = emptyList(), val phase: ToolLoopAgentState.Phase = Phase.Idle, val totalSteps: Int = 0, val lastFinishReason: FinishReason? = null)(source)
Since
0.3.0-beta01
Constructors
Link copied to clipboard
constructor(messages: List<ModelMessage> = emptyList(), streamingAssistantText: String = "", currentToolCalls: List<ContentPart.ToolCall> = emptyList(), pendingApprovals: List<PendingApproval> = emptyList(), phase: ToolLoopAgentState.Phase = Phase.Idle, totalSteps: Int = 0, lastFinishReason: FinishReason? = null)
Properties
Link copied to clipboard
Tool calls the model has emitted in the current in-flight step.
Link copied to clipboard
Finish reason of the most recent completed loop.
Link copied to clipboard
Persistent log of all messages — system, user, assistant, tool.
Link copied to clipboard
Tool calls awaiting user approval — non-empty pauses the loop.
Link copied to clipboard
Current lifecycle phase of the engine.
Link copied to clipboard
Text accumulating on the in-flight assistant message, before the step closes.
Link copied to clipboard
Total step count across all actions for this agent's lifetime.