fix: model selection

This commit is contained in:
2026-02-11 19:12:54 +01:00
parent 49f2b620db
commit 498bda542f
3 changed files with 5 additions and 3 deletions

View File

@@ -55,6 +55,8 @@
right: 0;
margin-top: 4px;
min-width: 160px;
max-height: 300px;
overflow-y: auto;
background-color: var(--vscode-dropdown-background);
border: 1px solid var(--vscode-dropdown-border);
border-radius: 4px;

View File

@@ -44,7 +44,7 @@ export const ChatPanel: React.FC<ChatPanelProps> = ({ conversationId }) => {
// Load conversation and messages
const loadData = useCallback(async () => {
try {
const [conv, msgs, models] = await Promise.all([
const [conv, msgs, modelsResult] = await Promise.all([
window.electronAPI?.chat.getConversation(conversationId),
window.electronAPI?.chat.getHistory(conversationId),
window.electronAPI?.chat.getAvailableModels()
@@ -52,7 +52,7 @@ export const ChatPanel: React.FC<ChatPanelProps> = ({ conversationId }) => {
if (conv) setConversation(conv);
if (msgs) setMessages(msgs);
if (models) setAvailableModels(models);
if (modelsResult?.models) setAvailableModels(modelsResult.models);
} catch (error) {
console.error('Failed to load chat data:', error);
}

View File

@@ -341,7 +341,7 @@ export interface ElectronAPI {
getApiKey: () => Promise<ChatApiKeyStatus>;
// Settings
getAvailableModels: () => Promise<ChatModel[]>;
getAvailableModels: () => Promise<{ success: boolean; models?: ChatModel[]; selectedModel?: string; error?: string }>;
setDefaultModel: (modelId: string) => Promise<void>;
getSystemPrompt: () => Promise<string | null>;
setSystemPrompt: (prompt: string) => Promise<void>;