24 lines
907 B
TypeScript
24 lines
907 B
TypeScript
import { describe, expect, it } from 'vitest'
|
|
|
|
import { appendTranscriptMessage } from './messages.js'
|
|
|
|
describe('appendTranscriptMessage', () => {
|
|
it('merges adjacent tool-only shelves into one transcript row', () => {
|
|
const out = appendTranscriptMessage(
|
|
[{ kind: 'trail', role: 'system', text: '', tools: ['Terminal("one") ✓'] }],
|
|
{ kind: 'trail', role: 'system', text: '', tools: ['Terminal("two") ✓'] }
|
|
)
|
|
|
|
expect(out).toEqual([{ kind: 'trail', role: 'system', text: '', tools: ['Terminal("one") ✓', 'Terminal("two") ✓'] }])
|
|
})
|
|
|
|
it('does not merge tool shelves across thinking text', () => {
|
|
const out = appendTranscriptMessage(
|
|
[{ kind: 'trail', role: 'system', text: '', thinking: 'plan', tools: ['Terminal("one") ✓'] }],
|
|
{ kind: 'trail', role: 'system', text: '', tools: ['Terminal("two") ✓'] }
|
|
)
|
|
|
|
expect(out).toHaveLength(2)
|
|
})
|
|
})
|