Skip to content

Commit 3e2c7ca

Browse files
fix(web): keep queued threads subscribed
Narrowed per triage: keep-alive is desktop-Electron only and waiting is a short post-success state. Queued shell status still needs to stay mounted so a desktop connecting while a follow-up is queued behind an active run pre-mounts instead of snapshot-loading.
1 parent b760a44 commit 3e2c7ca

2 files changed

Lines changed: 4 additions & 8 deletions

File tree

‎apps/web/src/state/threads.test.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,10 @@ describe("createRunningThreadKeepAliveAtom", () => {
159159
expect(h.openStreams()).toEqual([]);
160160
});
161161

162-
it("keeps queued and waiting threads open", () => {
162+
it("keeps queued threads open", () => {
163163
const h = makeHarness();
164-
h.registry.set(h.threads(LOCAL), [shell("a", "queued"), shell("b", "waiting")]);
165-
expect(h.openStreams()).toEqual(["local:a", "local:b"]);
164+
h.registry.set(h.threads(LOCAL), [shell("a", "queued")]);
165+
expect(h.openStreams()).toEqual(["local:a"]);
166166
});
167167

168168
it("follows environments that connect and go away", () => {

‎apps/web/src/state/threads.ts‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,7 @@ export function useEnvironmentThread(
5151
}
5252

5353
const isRunning = (status: string) =>
54-
status === "preparing" ||
55-
status === "queued" ||
56-
status === "starting" ||
57-
status === "running" ||
58-
status === "waiting";
54+
status === "preparing" || status === "queued" || status === "starting" || status === "running";
5955

6056
type KeptThreads = ReadonlyMap<EnvironmentId, ReadonlySet<ThreadId>>;
6157

0 commit comments

Comments
 (0)