diff --git a/web/workspace/src/routes/w/[workspaceId]/workers/[workerRef]/console/+page.svelte b/web/workspace/src/routes/w/[workspaceId]/workers/[workerRef]/console/+page.svelte index c6a7606ff..156aec76f 100644 --- a/web/workspace/src/routes/w/[workspaceId]/workers/[workerRef]/console/+page.svelte +++ b/web/workspace/src/routes/w/[workspaceId]/workers/[workerRef]/console/+page.svelte @@ -934,7 +934,7 @@ } function connectProtocolTransport( - _targetWorker: Worker | null, + targetWorker: Worker | null, token: number, target: ConsoleTarget, ) { @@ -984,6 +984,23 @@ ]; return; } + if ( + action.kind === "subscribe_live" && + targetWorker && + targetWorker.state === "stopped" + ) { + protocolState = "closed"; + streamDiagnostics = [ + ...streamDiagnostics, + { + code: "worker_session_state_changed", + severity: "warning", + message: + "The Session is live but the Worker is stopped. Reload to refresh its state.", + }, + ]; + return; + } if (action.kind === "subscribe_live") { closeLiveSubscription = connectLiveProtocolTransport(token, target); return;