fix: harden run completion checks and graceful timeout

This commit is contained in:
YeonGyu-Kim
2026-02-17 14:43:27 +09:00
parent 873c29f3d9
commit 0e1c55c5cb
5 changed files with 124 additions and 13 deletions
+19
View File
@@ -143,6 +143,25 @@ describe("checkCompletionConditions", () => {
expect(result).toBe(false)
})
it("returns false when child status is missing", async () => {
// given
spyOn(console, "log").mockImplementation(() => {})
const ctx = createMockContext({
childrenBySession: {
"test-session": [{ id: "child-1" }],
"child-1": [],
},
statuses: {},
})
const { checkCompletionConditions } = await import("./completion")
// when
const result = await checkCompletionConditions(ctx)
// then
expect(result).toBe(false)
})
it("returns true when all descendants idle (recursive)", async () => {
// given
spyOn(console, "log").mockImplementation(() => {})