feat(server): refactor copilot (#14892)

#### PR Dependency Tree


* **PR #14892** 👈

This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)
This commit is contained in:
DarkSky
2026-05-04 00:36:47 +08:00
committed by GitHub
parent fa8f1a096c
commit d64f368623
239 changed files with 35859 additions and 16777 deletions
+6 -7
View File
@@ -154,15 +154,14 @@ export async function cleanupWorkspace(workspaceId: string): Promise<void> {
export async function switchDefaultChatModel(model: string) {
await runPrisma(async client => {
const promptId = await client.aiPrompt
.findFirst({
where: { name: 'Chat With AFFiNE AI' },
select: { id: true },
})
.then(f => f!.id);
const prompt = await client.aiPrompt.findFirst({
where: { name: 'Chat With AFFiNE AI' },
select: { id: true },
});
if (!prompt) return;
await client.aiPrompt.update({
where: { id: promptId },
where: { id: prompt.id },
data: { model },
});
});