Refactor AI chat: streaming, tool calls, UI polish
All checks were successful
CI / check (pull_request) Successful in 3m25s

This commit is contained in:
2026-07-24 16:27:50 +08:00
parent e605586fc9
commit 8656394b9b
55 changed files with 2774 additions and 460 deletions

View File

@@ -11,6 +11,18 @@ describe('AI chat history mapper', () => {
status: 'completed',
errorCode: null,
createdAt: '2026-07-23T00:00:00.000Z',
feedback: 'like',
attachments: [
{
id: 8,
name: '考勤.pdf',
mimeType: 'application/pdf',
size: 100,
status: 'ready',
url: '/api/ai/chat/attachments/8',
createdAt: '2026-07-24T00:00:00.000Z',
},
],
toolRuns: [
{
toolCallId: 'tool-1',
@@ -24,6 +36,8 @@ describe('AI chat history mapper', () => {
expect(mapped.status).toBe('success');
expect(mapped.message.reasoningContent).toBe('思考');
expect(mapped.message.toolRuns[0].summary).toBe('共 4 间');
expect(mapped.message.attachments).toHaveLength(1);
expect(mapped.message.feedback).toBe('like');
});
it('maps failed and cancelled history to X SDK statuses', () => {