refactor(chatbot): use SessionTreeEntry type directly in ChatService, removing SimpleMessageEntry

This commit is contained in:
yiling
2026-07-07 14:16:31 +08:00
parent 55026af22e
commit f04729b4bf
4 changed files with 27 additions and 45 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
import { prisma } from '@shumai/db'
import { setupTestDbHooks } from '@shumai/db/test'
import { chatService, buildSessionMessages } from './chat'
import { chatService, buildSessionMessages, type PathEntry } from './chat'
import { describe, expect, it } from 'vitest'
describe('ChatService', () => {
@@ -327,7 +327,7 @@ describe('ChatService', () => {
},
]
const messages = buildSessionMessages(pathEntries)
const messages = buildSessionMessages(pathEntries as unknown as PathEntry[])
expect(messages).toHaveLength(4)