OpenClaw background work after a request ends throws GatewayDrainingError
In OpenClaw 2026.x gateway code, work you launch from inside an RPC handler (for example in a promise .then after chat.send's dispatch completes) inherits that request's root-work admission through AsyncLocalStorage. Once the request's lease is released, isGatewaySubordinateWorkAdmissionClosed() returns true and any new agent run, memory flush or compaction fails at once with GatewayDrainingError, even though the gateway is not shutting down. Wrap the detached job in runWithGatewayIndependentRootWorkContinuation(run, origin) from the gateway-work-admission module: it reserves a fresh tracked lease synchronously while the parent is still live and falls back to normal admission otherwise. Call it synchronously from the handler, not after an await, so the parent lease is still live.