From fb05cf0200e347256b0421b5c0e8d60a7f6c2584 Mon Sep 17 00:00:00 2001 From: Ishaan Jaffer Date: Wed, 6 May 2026 16:10:44 -0700 Subject: [PATCH] test(agent-sdk): switch removed Run.conversation() test to session.conversation() Also update the wait() test to expect the new 'finished' terminal status. --- sdks/typescript-agent-sdk/tests/run.test.ts | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/sdks/typescript-agent-sdk/tests/run.test.ts b/sdks/typescript-agent-sdk/tests/run.test.ts index a175d6c3b5c..00e25567910 100644 --- a/sdks/typescript-agent-sdk/tests/run.test.ts +++ b/sdks/typescript-agent-sdk/tests/run.test.ts @@ -34,7 +34,7 @@ describe("Run", () => { const result = await run.wait(); expect(result.id).toBe(run.id); - expect(result.status).toBe("completed"); + expect(result.status).toBe("finished"); expect(result.result).toBe("ok"); }); @@ -83,7 +83,9 @@ describe("Run", () => { await expect(run.cancel()).resolves.toBeUndefined(); }); - it("conversation() returns the turn list scoped to this run", async () => { + it("session.conversation() returns the turn list including the run's user message", async () => { + // `Run.conversation()` was removed — there is no per-run backend endpoint. + // Conversation history is session-scoped; callers use SessionHandle instead. const agent = await Agent.create({ apiKey: "test-key", baseUrl, @@ -91,11 +93,11 @@ describe("Run", () => { model: { id: "m" }, }); const session = await agent.createSession(); - const run = await session.send("hello run"); - const turns = await run.conversation(); - expect(turns.some((t) => t.content === "hello run" && t.role === "user")).toBe( - true - ); + await session.send("hello run"); + const turns = await session.conversation(); + expect( + turns.some((t) => t.content === "hello run" && t.role === "user"), + ).toBe(true); }); it("stream() respects an AbortSignal", async () => {