From ccfd2f4157c1cbbb3d8aeceee94d9e963a82ab03 Mon Sep 17 00:00:00 2001 From: Adam Malczewski Date: Sun, 7 Jun 2026 18:56:16 +0900 Subject: fix(core): add step-complete contract guard for wire@0.3.0 The backend's AgentEvent union now includes TurnStepCompleteEvent (wire/transport-contract 0.3.0). Add: no-op case in foldEvent (transcript reducer ignores timing metadata), exhaustiveness case in assertAgentEventExhaustive, and a step-complete sample in the conformance test (now 12 variants). --- src/core/wire/conformance.test.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/core/wire/conformance.test.ts') diff --git a/src/core/wire/conformance.test.ts b/src/core/wire/conformance.test.ts index 50b7f35..690ba4e 100644 --- a/src/core/wire/conformance.test.ts +++ b/src/core/wire/conformance.test.ts @@ -62,6 +62,15 @@ describe("classifies every AgentEvent type", () => { turnId: "t1", usage: { inputTokens: 10, outputTokens: 20 }, }, + { + type: "step-complete", + conversationId: "c1", + turnId: "t1", + stepId: "t1#0" as StepId, + ttftMs: 300, + decodeMs: 700, + genTotalMs: 1000, + }, { type: "error", conversationId: "c1", turnId: "t1", message: "oops" }, { type: "done", conversationId: "c1", turnId: "t1", reason: "complete" }, { type: "turn-sealed", conversationId: "c1", turnId: "t1" }, @@ -78,14 +87,15 @@ describe("classifies every AgentEvent type", () => { "tool-result", "tool-output", "usage", + "step-complete", "error", "done", "turn-sealed", ]); }); - it("covers all 11 AgentEvent variants", () => { - expect(samples).toHaveLength(11); + it("covers all 12 AgentEvent variants", () => { + expect(samples).toHaveLength(12); }); }); -- cgit v1.2.3