mirror of
https://github.com/stablyai/orca.git
synced 2026-10-26 00:03:55 +00:00
test(native-chat): an epoch replacement reaches the open chat
This commit is contained in:
+14
@@ -68,6 +68,20 @@ describe('a conversation delivers what its journal commits', () => {
|
||||
expect(deliver).toHaveBeenCalledWith('session-1', journal)
|
||||
})
|
||||
|
||||
it('delivers an epoch replacement, which readers must reload from', async () => {
|
||||
const deliver = vi.fn()
|
||||
const conversations = new StructuredAgentSessionConversations({
|
||||
deliver,
|
||||
onDeliveryError: vi.fn()
|
||||
})
|
||||
const journal = await openJournal('a')
|
||||
conversations.set('session-1', session(journal))
|
||||
|
||||
await journal.replaceEpochItems('handle_forked', 0, [])
|
||||
|
||||
expect(deliver).toHaveBeenCalledExactlyOnceWith('session-1', journal)
|
||||
})
|
||||
|
||||
it('delivers nothing for a handle the conversation has replaced', async () => {
|
||||
const deliver = vi.fn()
|
||||
const conversations = new StructuredAgentSessionConversations({
|
||||
|
||||
Reference in New Issue
Block a user