Terminate Agent Exception
Exception thrown to immediately terminate the entire agent process.
When thrown from a tool, this exception propagates through the tool loop and action executor, causing the agent process to terminate immediately.
Use this for immediate termination. For graceful termination that waits for natural checkpoints, use com.embabel.agent.api.termination.terminateAgent.
Example usage:
@LlmTool(description = "Stops the agent when critical error detected")
fun criticalStop(reason: String): String {
throw TerminateAgentException("Critical error: $reason")
}Content copied to clipboard
Parameters
reason
Human-readable explanation for termination