javaApiInterceptAgentClosing
fun javaApiInterceptAgentClosing(feature: AIAgentFeature<*, *>, handle: Interceptor<AgentClosingContext>)(source)
Intercepts and sets a handler to be invoked before an agent is closed.
JVM-friendly overload that accepts an async interceptor.
Example (Java): pipeline.interceptAgentClosing(feature, eventContext -> { // Pre-close actions return java.util.concurrent.CompletableFuture.completedFuture(null); });