From 8500092296621a6826b7136e840f8a59ea338958 Mon Sep 17 00:00:00 2001 From: can1357 Date: Tue, 18 Aug 2026 11:34:10 +0300 Subject: [PATCH] chore: bump version to 17.3.7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Retry: widened agent dequeue-hook deadline budgets from 25ms to 1s — the run loop checks the deadline before invoking dequeue hooks, so a cold or CPU-starved mock roundtrip expired the deadline first and the hooks never ran (deterministic failure in isolation, flaky under CI parallel load). --- packages/agent/test/agent.test.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/agent/test/agent.test.ts b/packages/agent/test/agent.test.ts index 39cff8591..d41bfd693 100644 --- a/packages/agent/test/agent.test.ts +++ b/packages/agent/test/agent.test.ts @@ -279,7 +279,11 @@ describe("Agent", () => { }); it("keeps follow-up ownership when the deadline expires during a dequeue hook", async () => { const mock = createMockModel({ responses: [{ content: ["done"] }] }); - const agent = new Agent({ streamFn: mock.stream, deadline: Date.now() + 25 }); + // Generous budget: the loop checks the deadline before invoking dequeue + // hooks, so the mock roundtrip must beat it even on starved CI runners. + // The hook itself parks until the deadline timer aborts the loop signal, + // so the expiry-during-hook branch stays exercised. + const agent = new Agent({ streamFn: mock.stream, deadline: Date.now() + 1_000 }); let hookSignal: AbortSignal | undefined; agent.addBeforeQueuedMessageDequeueHook(async signal => { if (!signal) throw new Error("Expected the active loop signal"); @@ -297,7 +301,8 @@ describe("Agent", () => { expect(agent.peekFollowUpQueue()).toHaveLength(1); }); it("keeps queued work when continue() reaches its deadline inside a dequeue hook", async () => { - const agent = new Agent({ deadline: Date.now() + 25 }); + // Same starvation guard as above: hook entry must precede expiry. + const agent = new Agent({ deadline: Date.now() + 1_000 }); agent.replaceMessages([createAssistantMessage([{ type: "text", text: "ready" }])]); agent.addBeforeQueuedMessageDequeueHook(async signal => { if (!signal) throw new Error("Expected the deadline-aware dequeue signal");