onAssistantMessage

infix fun <IncomingOutput, IntermediateOutput, OutgoingInput> AIAgentEdgeBuilderIntermediate<IncomingOutput, IntermediateOutput, OutgoingInput>.onAssistantMessage(block: suspend (Message.Assistant) -> Boolean): AIAgentEdgeBuilderIntermediate<IncomingOutput, String, OutgoingInput>

Matches any assistant turn and forwards its text — the empty string when the turn carries none.

Koog 1.1 dropped onAssistantMessage, and its onTextMessage only matches a turn that contains a MessagePart.Text. An assistant turn made of reasoning alone — what a reasoning model returns when it hits its output-token cap while thinking — then matches neither that edge nor onToolCalls, and the run dies with AIAgentStuckInTheNodeException. Use this for the catch-all edge of a tool loop, declared after the onToolCalls one: edges resolve in declaration order and the first match wins.