feat(agent): persist assistant model preference

This commit is contained in:
ginnoir
2026-07-08 16:24:01 -05:00
parent 876e72671a
commit bf7e07ead9
5 changed files with 32 additions and 0 deletions
+3
View File
@@ -14,6 +14,7 @@ export type AssistantPreferences = {
enabled: boolean;
name: string;
systemPrompt: string | null;
model: string | null;
};
export async function getAssistantPreferences(userId: string): Promise<AssistantPreferences> {
@@ -22,6 +23,7 @@ export async function getAssistantPreferences(userId: string): Promise<Assistant
assistantEnabled: users.assistantEnabled,
assistantName: users.assistantName,
assistantSystemPrompt: users.assistantSystemPrompt,
assistantModel: users.assistantModel,
})
.from(users)
.where(eq(users.id, userId))
@@ -31,6 +33,7 @@ export async function getAssistantPreferences(userId: string): Promise<Assistant
enabled: row?.assistantEnabled ?? false,
name: row?.assistantName?.trim() || DEFAULT_ASSISTANT_NAME,
systemPrompt: row?.assistantSystemPrompt ?? null,
model: row?.assistantModel?.trim() || null,
};
}