| ... | @@ -19,7 +19,7 @@ import { createRunningThreadKeepAliveAtom } from "./threads"; | ... | @@ -19,7 +19,7 @@ import { createRunningThreadKeepAliveAtom } from "./threads"; |
| 19 | const LOCAL = EnvironmentId.make("local"); | 19 | const LOCAL = EnvironmentId.make("local"); |
| 20 | const REMOTE = EnvironmentId.make("remote"); | 20 | const REMOTE = EnvironmentId.make("remote"); |
| 21 | | 21 | |
| 22 | type Status = "running" | "starting" | "idle"; | 22 | type Status = "running" | "starting" | "preparing" | "queued" | "waiting" | "idle"; |
| 23 | function shell(id: string, status: Status | null) { | 23 | function shell(id: string, status: Status | null) { |
| 24 | return { id: ThreadId.make(id), status: status ?? "idle" } satisfies Pick< | 24 | return { id: ThreadId.make(id), status: status ?? "idle" } satisfies Pick< |
| 25 | OrchestrationV2ThreadShell, | 25 | OrchestrationV2ThreadShell, |
| ... | @@ -159,6 +159,12 @@ describe("createRunningThreadKeepAliveAtom", () => { | ... | @@ -159,6 +159,12 @@ describe("createRunningThreadKeepAliveAtom", () => { |
| 159 | expect(h.openStreams()).toEqual([]); | 159 | expect(h.openStreams()).toEqual([]); |
| 160 | }); | 160 | }); |
| 161 | | 161 | |
| | 162 | it("keeps queued threads open", () => { |
| | 163 | const h = makeHarness(); |
| | 164 | h.registry.set(h.threads(LOCAL), [shell("a", "queued")]); |
| | 165 | expect(h.openStreams()).toEqual(["local:a"]); |
| | 166 | }); |
| | 167 | |
| 162 | it("follows environments that connect and go away", () => { | 168 | it("follows environments that connect and go away", () => { |
| 163 | const h = makeHarness(); | 169 | const h = makeHarness(); |
| 164 | h.registry.set(h.environmentIds, [LOCAL]); | 170 | h.registry.set(h.environmentIds, [LOCAL]); |