feat(chat): collapse tool calls by run
Build / build (push) Canceled after 0s
Playwright / e2e (push) Canceled after 0s

This commit is contained in:
2026-11-05 11:40:51 +08:00
parent 276e2389d6
commit 1bdef36577
8 changed files with 56 additions and 3 deletions
+9
View File
@@ -316,6 +316,9 @@ test('renders tool trace and sends explicit approval decisions over the chat-run
})
}, run.session_id)
await expect(page.locator('.live-tool-group')).not.toHaveAttribute('open', '')
await expect(page.getByText('write_file', { exact: true })).toBeHidden()
await page.locator('.live-tool-group > summary').click()
await expect(page.getByText('write_file', { exact: true })).toBeVisible()
await expect(page.getByText('Writing approved file')).toBeVisible()
await expect(page.locator('.message.tool .tool-line')).toHaveCount(0)
@@ -393,6 +396,8 @@ test('renders tool trace and sends explicit approval decisions over the chat-run
const persistedToolTrace = page.locator('.message.tool .tool-line').filter({ hasText: 'write_file' })
await expect(persistedToolTrace).toHaveCount(1)
await expect(persistedToolTrace).toBeHidden()
await page.locator('.tool-group:not(.live-tool-group) > summary').click()
await persistedToolTrace.click()
const toolDetails = page.locator('.message.tool .tool-details')
await expect(toolDetails).toContainText('/tmp/approved.txt')
@@ -593,6 +598,8 @@ test('keeps completed same-run tool traces hidden until the run finishes', async
await expect(page.locator('.tool-calls-panel .tool-call-name').filter({ hasText: 'read_file' })).toHaveCount(0)
await expect(page.locator('.tool-calls-panel .tool-call-name').filter({ hasText: 'shell_exec' })).toHaveCount(0)
await expect(page.locator('.message.tool .tool-error-badge')).toHaveCount(1)
await expect(page.locator('.tool-group:not(.live-tool-group) > summary')).toHaveText('Tool calls (2)')
await page.locator('.tool-group:not(.live-tool-group) > summary').click()
await transcriptTools.filter({ hasText: 'shell_exec' }).click()
await expect(page.locator('.message.tool .tool-details')).toContainText('exit status 1')
await expect(page.getByText('Multi-tool fallback should stay hidden.')).toHaveCount(0)
@@ -849,6 +856,8 @@ test('restores named resumed tool traces from assistant tool calls after session
await expect(page.getByText('Named history answer visible.')).toBeVisible()
const restoredTrace = page.locator('.message.tool .tool-line').filter({ hasText: 'read_file' })
await expect(restoredTrace).toHaveCount(1)
await expect(restoredTrace).toBeHidden()
await page.locator('.tool-group > summary').click()
await restoredTrace.click()
await expect(page.locator('.message.tool .tool-details')).toContainText('/tmp/history.txt')
expect(api.unexpectedRequests).toEqual([])