refactor(agent-loop): simplify message machine
This commit is contained in:
@@ -47,7 +47,7 @@ describe('todo snapshot invariants', () => {
|
||||
expect(() => {
|
||||
ctx.emit('tools/change')
|
||||
ctx.emit('session/event', {} as Session, {
|
||||
type: 'turn/start', seq: 0, time: 0, data: { turn: 1, trigger: { kind: 'message', source: { kind: 'user' } } },
|
||||
type: 'turn/start', seq: 0, time: 0, data: { turn: 1 },
|
||||
})
|
||||
}).not.toThrow()
|
||||
})
|
||||
|
||||
@@ -99,7 +99,7 @@ describe('todos projection provider', () => {
|
||||
session.append('todo/write', { todos: list })
|
||||
session.append('turn/end', { turn: 0, reason: { kind: 'completed' } })
|
||||
expect((await bench.tailProjections())?.values.todos).toEqual(list)
|
||||
session.append('turn/start', { turn: 1, trigger: { kind: 'message', source: { kind: 'user' } } })
|
||||
session.append('turn/start', { turn: 1 })
|
||||
const cleared = await bench.tailProjections()
|
||||
expect(cleared?.values.todos).toBeNull()
|
||||
expect(cleared?.asOfSeq).toBe(session.seq - 1)
|
||||
|
||||
Reference in New Issue
Block a user