Terminate Action Exception
Exception thrown to immediately terminate the current action only.
When thrown from an action or tool, this exception terminates the current action's tool loop but allows the agent to continue with the next planned action.
Use this for immediate action termination. For graceful termination that waits for natural checkpoints, use com.embabel.agent.api.termination.terminateAction.
Example usage:
@Action
fun processStep(context: ActionContext): String {
if (shouldSkip()) {
throw TerminateActionException("Skipping: condition met")
}
// ... normal processing
}Content copied to clipboard
Parameters
reason
Human-readable explanation for termination