perf(session): reuse immutable event snapshots

This commit is contained in:
_Kerman
2026-08-28 13:43:16 +08:00
parent 5660f44d29
commit bcfec8d1c3
43 changed files with 116 additions and 116 deletions
+1 -1
View File
@@ -1526,7 +1526,7 @@ describe('agent loop', () => {
send(agent, 'run')
await waitForIdle(ctx, agent)
const replayed = ctx.sessions.create(SessionId('replayed'), { seed: [...agent.session.snapshotEvents()] })
const replayed = ctx.sessions.create(SessionId('replayed'), { seed: agent.session.snapshotEvents() })
expect(replayed.deriveMessages()).toEqual(agent.session.deriveMessages())
// event-by-event identity of types over the inherited prefix
expect(replayed.snapshotEvents().slice(0, agent.session.seq).map(e => e.type)).toEqual(