From 7506b8e9ba9d42990cc312be8b8b3ee02deb7eb9 Mon Sep 17 00:00:00 2001 From: Mario Zechner Date: Fri, 13 Mar 2026 22:48:55 +0100 Subject: [PATCH] fix(agent): remove broken async loop test --- packages/agent/test/agent-loop.test.ts | 32 -------------------------- 1 file changed, 32 deletions(-) diff --git a/packages/agent/test/agent-loop.test.ts b/packages/agent/test/agent-loop.test.ts index 50bfb16b..21290f16 100644 --- a/packages/agent/test/agent-loop.test.ts +++ b/packages/agent/test/agent-loop.test.ts @@ -128,38 +128,6 @@ describe("agentLoop with AgentMessage", () => { expect(eventTypes).toContain("agent_end"); }); - it("should terminate the stream when the async loop throws before agent_end", async () => { - const context: AgentContext = { - systemPrompt: "You are helpful.", - messages: [], - tools: [], - }; - - const userPrompt: AgentMessage = createUserMessage("Hello"); - const config: AgentLoopConfig = { - model: createModel(), - convertToLlm: identityConverter, - }; - - const events: AgentEvent[] = []; - const stream = agentLoop([userPrompt], context, config, undefined, async () => { - throw new Error("boom"); - }); - - const result = await Promise.race([ - (async () => { - for await (const event of stream) { - events.push(event); - } - return "completed" as const; - })(), - new Promise<"timeout">((resolve) => setTimeout(() => resolve("timeout"), 50)), - ]); - - expect(result).toBe("timeout"); - expect(events.map((e) => e.type)).not.toContain("agent_end"); - }); - it("should handle custom message types via convertToLlm", async () => { // Create a custom message type interface CustomNotification {