feat: auto select the first model as default model

This commit is contained in:
Henry Li
2026-01-26 17:13:34 +08:00
parent 22004406a7
commit 3ce4968e95
4 changed files with 17 additions and 8 deletions

View File

@@ -2,10 +2,11 @@ import { useQuery } from "@tanstack/react-query";
import { loadModels } from "./api";
export function useModels() {
export function useModels({ enabled = true }: { enabled?: boolean } = {}) {
const { data, isLoading, error } = useQuery({
queryKey: ["models"],
queryFn: () => loadModels(),
enabled,
});
return { models: data ?? [], isLoading, error };
}

View File

@@ -2,9 +2,9 @@ import type { AgentThreadContext } from "../threads";
export const DEFAULT_LOCAL_SETTINGS: LocalSettings = {
context: {
model_name: "deepseek-v3.2",
model_name: undefined,
thinking_enabled: true,
is_plan_mode: false,
is_plan_mode: true,
},
layout: {
sidebar_collapsed: false,

View File

@@ -14,7 +14,7 @@ export interface AgentThread extends Thread<AgentThreadState> {}
export interface AgentThreadContext extends Record<string, unknown> {
thread_id: string;
model_name: string;
model_name: string | undefined;
thinking_enabled: boolean;
is_plan_mode: boolean;
}