pub async fn restart_backend(state: Arc<AppState>) -> Result<Value, String>Expand description
Restart the agentmux-srv backend sidecar.
Phase B.1: in launcher-managed runs (AGENTMUX_BACKEND_PID env
is set by the launcher), the host does NOT own the srv child
handle — state.sidecar_child stays None. Naively running the
kill-then-spawn flow here would skip killing the launcher’s srv
(no handle to kill) and spawn a SECOND srv touching the same
data dir, corrupting state. Refuse with a clear message until
Phase B.2 wires a Quit command from host to launcher to do the
restart cleanly. (codex P2 @ sidecar.rs:58, PR #571 round-3.)