mirror of
https://github.com/stablyai/orca.git
synced 2026-10-06 16:02:25 +00:00
* fix(wsl): scan sessions only in running distros * test(ai-vault): pin WSL discovery platform * fix(wsl): suspend transcript watchers for stopped distros * test(wsl): pin transcript scan gate platform * fix(wsl): settle stopped transcript loading * fix(wsl): add last-known-good fallback and backoff to running-distro discovery listRunningWslDistrosAsync failed closed on any probe error (timeout, ENOENT, wsl.exe hiccup), indistinguishable from "no distros running". A 2s poll (wsl-transcript-running-observer.ts) calls it indefinitely while any WSL transcript tab is open, so a persistently broken wsl.exe silently made every WSL session vanish app-wide with no way to tell "discovery broken" from "distro stopped", and re-spawned wsl.exe every 2s forever. Extract a dedicated cache/backoff module (wsl-running-distro-cache.ts, mirroring the sibling machinery already in wsl.ts for the full distro list) so a probe failure falls back to the last-known-good running-distro list and backs off further probes, while a genuine empty result (no distros running) stays authoritative. Add a consumer-level test simulating a sustained wsl.exe outage across a live transcript-watcher polling session, asserting the observer keeps reporting "running" and that real wsl.exe spawns stay bounded. * fix(build): list the new WSL cache module in the web typecheck project config/tsconfig.tc.web.json enumerates its files explicitly, so a new module imported by wsl.ts fails the full typecheck with TS6307 until it is listed. pnpm tc:node passes without it, which is how this got missed. src/main/wsl.ts(13,8): error TS6307: File 'src/main/wsl-running-distro-cache.ts' is not listed within the file list of project 'config/tsconfig.tc.web.json'. --------- Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com> Co-authored-by: Neil <4138956+nwparker@users.noreply.github.com>
22 lines
604 B
TypeScript
22 lines
604 B
TypeScript
import { wslGatedStat } from './wsl-transcript-fs-access'
|
|
import { WslTranscriptFsError } from './wsl-transcript-fs-gate'
|
|
import { transcriptWatcherPathIsRunning } from './wsl-transcript-watcher-running-guard'
|
|
|
|
export async function transcriptWatcherPathIsInstallable(
|
|
filePath: string,
|
|
signal?: AbortSignal
|
|
): Promise<boolean> {
|
|
if (!(await transcriptWatcherPathIsRunning(filePath))) {
|
|
return false
|
|
}
|
|
try {
|
|
await wslGatedStat(filePath, 'exact', signal)
|
|
return true
|
|
} catch (error) {
|
|
if (error instanceof WslTranscriptFsError) {
|
|
throw error
|
|
}
|
|
return false
|
|
}
|
|
}
|