fix(chat): separate merged output segments
Build / build (push) Canceled after 0s
Playwright / e2e (push) Canceled after 0s

This commit is contained in:
2026-11-05 15:52:53 +08:00
parent 43eda89d47
commit 10ce9e5c28
7 changed files with 42 additions and 7 deletions
+8
View File
@@ -57,6 +57,7 @@ test('streams a run and renders markdown, code, math and mermaid without leaking
}, sessionId)
const bubble = page.locator('.message').last()
await expect(bubble.locator('.assistant-segment-divider')).toHaveCount(0)
await expect(bubble.locator('strong')).toHaveText('bold')
await expect(bubble.locator('code')).toHaveCount(2)
await expect(bubble.locator('.katex')).toHaveCount(1)
@@ -132,11 +133,18 @@ test('groups assistant output across tool calls until the run ends', async ({ pa
await expect(assistant).toHaveCount(1)
await expect(assistant).toContainText('First update')
await expect(assistant).toContainText('Second update')
await expect(assistant.locator('.assistant-segment-divider')).toHaveCount(1)
await expect(assistant.locator('.message-bubble')).toHaveCount(1)
await expect(page.locator('.run-end')).toHaveCount(0)
await page.evaluate((sid) => {
(window as any).__PW_CHAT_SOCKET__.latest.__trigger('run.completed', { event: 'run.completed', session_id: sid, run_id: 'grouped-run' })
}, sessionId)
await expect(page.locator('.run-end')).toHaveText('Run output ended')
await expect.poll(async () => {
const bubble = await assistant.locator('.message-bubble').boundingBox()
const end = await page.locator('.run-end').boundingBox()
return bubble && end ? end.y - (bubble.y + bubble.height) : Infinity
}).toBeLessThan(50)
})
test('shows agent activity under its own avatar before the answer', async ({ page }) => {