File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ import { createRunningThreadKeepAliveAtom } from "./threads";
1919const LOCAL = EnvironmentId . make ( "local" ) ;
2020const REMOTE = EnvironmentId . make ( "remote" ) ;
2121
22- type Status = "running" | "starting" | "idle" ;
22+ type Status = "running" | "starting" | "preparing" | "queued" | "waiting" | " idle";
2323function shell ( id : string , status : Status | null ) {
2424 return { id : ThreadId . make ( id ) , status : status ?? "idle" } satisfies Pick <
2525 OrchestrationV2ThreadShell ,
@@ -159,6 +159,12 @@ describe("createRunningThreadKeepAliveAtom", () => {
159159 expect ( h . openStreams ( ) ) . toEqual ( [ ] ) ;
160160 } ) ;
161161
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+
162168 it ( "follows environments that connect and go away" , ( ) => {
163169 const h = makeHarness ( ) ;
164170 h . registry . set ( h . environmentIds , [ LOCAL ] ) ;
Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ export function useEnvironmentThread(
5151}
5252
5353const isRunning = ( status : string ) =>
54- status === "preparing" || status === "starting" || status === "running" ;
54+ status === "preparing" || status === "queued" || status === " starting" || status === "running" ;
5555
5656type KeptThreads = ReadonlyMap < EnvironmentId , ReadonlySet < ThreadId > > ;
5757
You can’t perform that action at this time.
0 commit comments