pub async fn spawn_ws_session(
cfg: SharedConfig,
stop: Arc<AtomicBool>,
logs: Arc<Mutex<Vec<LogEntry>>>,
busy: Arc<AtomicBool>,
paused: Arc<AtomicBool>,
observers: WorkerObservers,
schedule: SessionSchedule,
) -> Result<()>Expand description
Top-level driver: connect, run a session, reconnect on disconnect,
give up after cfg.ws_reconnect_attempts failures.
paused is a runtime-only flag (not persisted to Config). When
true, the heartbeat reports autoEnabled = false and incoming
offers are rejected, so the studio stops sending new jobs. In-
flight work is allowed to finish.