Class AgentscopeDrainEndpoint

java.lang.Object
io.agentscope.spring.boot.admin.endpoint.AgentscopeDrainEndpoint

@Endpoint(id="agentscope-drain") public class AgentscopeDrainEndpoint extends Object
POST /actuator/agentscope-drain: stop accepting new agent requests, wait for in-flight ones to finish, but do NOT terminate the JVM.

This is the production-friendly "let me bring this node out of the load balancer" knob: health probes (e.g. /actuator/health) can flip to red, in-flight reasoning completes naturally, and the process stays alive for log collection.

Drain is idempotent — second invocation is a no-op. Because Actuator's @WriteOperation does not surface raw HTTP headers, the token check is enforced via the confirm parameter; production deployments should layer Spring Security on top of /actuator/**.