fix(native-chat): scope composer sends to the active turn (#8568)
* fix(native-chat): scope composer sends to the active turn * fix(native-chat): close pending send lifecycle gaps * fix(native-chat): deduplicate pending message derivation
This commit is contained in:
@@ -47,6 +47,22 @@ describe('deriveNativeChatStreamingText', () => {
|
||||
).toBe('Working on it')
|
||||
})
|
||||
|
||||
it('treats an optimistic user echo as the active streaming-turn boundary', () => {
|
||||
const optimistic = {
|
||||
...user('new prompt'),
|
||||
id: 'pending:send-1',
|
||||
timestamp: 20,
|
||||
source: 'scrape' as const
|
||||
}
|
||||
expect(
|
||||
deriveNativeChatStreamingText({
|
||||
messages: [assistant('A much longer answer from the completed prior turn'), optimistic],
|
||||
previewText: 'New reply',
|
||||
working: true
|
||||
})
|
||||
).toBe('New reply')
|
||||
})
|
||||
|
||||
it('drops the preview once the real assistant turn contains it (no duplicate)', () => {
|
||||
expect(
|
||||
deriveNativeChatStreamingText({
|
||||
|
||||
Reference in New Issue
Block a user