Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(orchestration): do not revive idle tasks from status-free progress #7172

Mergedmaslinedwin(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/7172/headmerged by shivamhwp(GitHub profile, opens in a new tab) View on GitHub

Showing 2 changed files with 39 additions and 0 deletions.

x
0 of 2 viewed, 2 left
26 additions and 0 deletionsapps/server/src/orchestration/ThreadBackgroundLiveness.test.tsModified
View file
@@ -2,6 +2,32 @@
import * as ThreadBackgroundLiveness from "./ThreadBackgroundLiveness.ts";
​
describe("ThreadBackgroundLiveness", () => {
+ it("does not let status-free progress restart an idle task", () => {
+ const liveness = ThreadBackgroundLiveness.make();
+ liveness.recordTaskLiveness({
+ threadId: "thread",
+ taskId: "task",
+ taskType: undefined,
+ status: undefined,
+ kind: "started",
+ });
+ liveness.recordTaskLiveness({
+ threadId: "thread",
+ taskId: "task",
+ taskType: undefined,
+ status: "idle",
+ kind: "updated",
+ });
+ liveness.recordTaskLiveness({
+ threadId: "thread",
+ taskId: "task",
+ taskType: undefined,
+ status: undefined,
+ kind: "progress",
+ });
+ expect(liveness.getThreadBackgroundLiveness("thread")).toBeNull();
+ });
+​