Files
orca/src/shared/runtime-workspace-window-availability.ts
T
Neilandgatsby74 f968583e95 fix(remote): stop a reachable Orca server with a closed workspace window from reading Ready (#12477)
A remote Orca server whose workspace window is closed keeps answering status RPC, so Settings > Available Hosts showed "Ready" and the status bar showed "Connected" while every graph-backed operation failed. Adds the shared predicate `isRuntimeWorkspaceWindowClosed` (`graphStatus !== 'ready' && desktopWindowStatus === 'openable'`) and one host-health derivation with a new `workspace-window-closed` state, consumed by both surfaces. Hosts that omit `desktopWindowStatus` are unaffected, so the connected-host count and overall dot do not regress.

Fixes #12350

Co-authored-by: gatsby74 <gatsby74@users.noreply.github.com>
2026-08-07 21:11:31 -07:00

15 lines
777 B
TypeScript

import type { RuntimeStatus } from './runtime-types'
// Why: a headed Orca server keeps answering status.get after its workspace window
// closes, so "a status came back" is not evidence that graph-backed workspace work
// will succeed there. desktopWindowStatus is only 'openable' when no live renderer
// window exists (orca-runtime.ts:4806), so pairing it with a non-ready graph is the
// narrow "reachable, but nothing can run" signal: a graph-ready headless serve
// (#6844) and hosts that omit desktopWindowStatus (older builds) stay untouched.
export function isRuntimeWorkspaceWindowClosed(status: RuntimeStatus | null | undefined): boolean {
if (!status) {
return false
}
return status.graphStatus !== 'ready' && status.desktopWindowStatus === 'openable'
}