Close retired RPC connections after draining replies
Merged
AN
8h ago+205+205+012345678901234567890123456789-3-3-0123456789
Close retired RPC connections after draining replies. Worker delivery rebased onto main; see the commit messages.
Summary by cubic
Fixes a stale-connection race where the OpenCode TUI's /claude menu briefly errored with "unauthorized" or a dropped connection after a plugin reload.
- Stop now marks draining responses
Connection: closeand destroys all remaining owned sockets after replies drain. - The connection-pool opt-out (keepalive) is preserved through the loopback network guard and across redirects.
- Adds deterministic tests for stop draining and pool opt-out preservation.