diff --git a/src/renderer/src/lib/orca-cloud-session-events.ts b/src/renderer/src/lib/orca-cloud-session-events.ts index e0c23c73aa6..387db23915f 100644 --- a/src/renderer/src/lib/orca-cloud-session-events.ts +++ b/src/renderer/src/lib/orca-cloud-session-events.ts @@ -1,4 +1,5 @@ // Window side of Orca Cloud's session lifecycle: cap warnings, rollovers and idle sleep from main. +import { syncRunActionsWithWake } from '@/lib/orca-cloud/cloud-run-action-relaunch' import { armRunActionRelaunch, disarmRunActionRelaunch, @@ -98,6 +99,9 @@ export function installOrcaCloudSessionEvents(): () => void { } }) }) + // Woken VMs have fresh shells: run actions (dev servers) that were up start again. + const disposeRunActionWake = + window.api?.orcaCloudWorkspace?.onWakeProgress?.(syncRunActionsWithWake) ?? (() => {}) const disposeStore = installOrcaCloudWorkspaceStore() const disposePredictive = installCloudPredictiveWake() return () => { @@ -105,6 +109,7 @@ export function installOrcaCloudSessionEvents(): () => void { disposeState() disposeIdle() disposeStore() + disposeRunActionWake() disposePredictive() } } diff --git a/src/renderer/src/lib/orca-cloud/orca-cloud-workspace-store.ts b/src/renderer/src/lib/orca-cloud/orca-cloud-workspace-store.ts index 40a6c082615..beb3f985fd1 100644 --- a/src/renderer/src/lib/orca-cloud/orca-cloud-workspace-store.ts +++ b/src/renderer/src/lib/orca-cloud/orca-cloud-workspace-store.ts @@ -2,7 +2,6 @@ // status from the control plane, in-flight wakes and OOM notices. The one source of cloud ids and // wake state for every cloud surface. A tiny external store (not an app-store slice) so the // hundreds of sidebar rows that are not cloud workspaces subscribe to nothing. -import { syncRunActionsWithWake } from './cloud-run-action-relaunch' import { armInterruptedTurnsForHostRestart, continueInterruptedTurns, @@ -270,7 +269,6 @@ export function noteCloudWakeProgress(reported: CloudWakeProgressEvent): void { if (event.phase === 'failed' && isSilentPredictiveWake(event.workspaceId)) { dropWake(event.workspaceId) endWorkspaceWake(event.workspaceId, 'failed') - syncRunActionsWithWake(event) void refreshCloudWorkspaceStatus(event.workspaceId) return } @@ -290,8 +288,6 @@ export function noteCloudWakeProgress(reported: CloudWakeProgressEvent): void { } else { endWorkspaceWake(event.workspaceId, event.phase === 'ready' ? 'ready' : 'failed') } - // The woken VM has fresh shells: dev servers (run actions) that were up start again. - syncRunActionsWithWake(event) // Restart reboots the host under any working agent: carry its interrupted turn on afterwards. if (next.source === 'restart') { if (event.phase === 'waking' && (!started || started.startedAt !== event.startedAt)) {