fix(look-at): avoid empty stable idle completion

This commit is contained in:
YeonGyu-Kim
2026-05-21 12:54:56 +09:00
parent 6e6f300c7d
commit bd55396266
3 changed files with 20 additions and 1 deletions
+12
View File
@@ -78,6 +78,18 @@ describe("waitForLookAtSessionResult", () => {
expect(result.outcome.text).toBe("done")
})
test("#given session is absent and has no assistant output #when stable idle is allowed #then keeps polling", async () => {
const client = createMockClient([{ data: {} }], [])
await expect(
waitForLookAtSessionResult(unsafeTestValue(client), "ses_test", {
pollIntervalMs: 10,
timeoutMs: 50,
allowStableIdleWithoutActivity: true,
}),
).rejects.toThrow("timed out")
})
test("#given session never becomes idle #when polling exceeds timeout #then rejects", async () => {
const client = createMockClient(
[{ data: { ses_test: { type: "busy" } } }],