From c594f28df67eee71b18438cb271b73d60949a041 Mon Sep 17 00:00:00 2001 From: ScriptedAlchemy Date: Tue, 8 Sep 2026 05:47:44 +0000 Subject: [PATCH] fix(test): compare invocation replay with retained suffix --- .../agent-bundle/tests/route-invocation-dev-server.test.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/agent-bundle/tests/route-invocation-dev-server.test.ts b/packages/agent-bundle/tests/route-invocation-dev-server.test.ts index fe7ce997f..c99822ad0 100644 --- a/packages/agent-bundle/tests/route-invocation-dev-server.test.ts +++ b/packages/agent-bundle/tests/route-invocation-dev-server.test.ts @@ -1997,7 +1997,8 @@ it('bounds the render history a compiled child produces by count and bytes acros expect(JSON.stringify(cancelled.document)).toContain(`${String(boundaries - 1)}:`); const reconnected = await readInvocationStream(reconnectedResponse); expect(reconnected[0]).toEqual({ type: 'truncated' }); - expect(renderEvents(reconnected)).toEqual(cancelled.events); + // A live reconnect may include replay events evicted before the terminal envelope. + expect(renderEvents(reconnected).slice(-cancelled.events.length)).toEqual(cancelled.events); expect(reconnected.at(-1)).toEqual({ invocation: cancelled, type: 'final' }); await live.next(isFinal); expect(live.seen.filter((message) => message.type === 'truncated')).toHaveLength(1);