refactor(cloud): run-action wake relaunch subscribes to wake progress itself (store stays under max-lines)

This commit is contained in:
Neil
2026-11-10 01:35:06 -08:00
parent 118c74fb51
commit bf7477e1ce
2 changed files with 5 additions and 4 deletions
@@ -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()
}
}
@@ -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)) {