mirror of
https://github.com/davidkaya/aryx.git
synced 2026-07-30 08:28:48 +02:00
fix: show default model selected when opening Quick Prompt
When no explicit default model is configured in settings, fall back to the first available model so the input bar always displays a selected model name instead of 'Select model'. Also always reset model/reasoning to defaults on each new prompt activation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -39,7 +39,7 @@ export function QuickPromptApp() {
|
||||
useEffect(() => {
|
||||
api.getCapabilities().then((caps) => {
|
||||
setCapabilities(caps);
|
||||
setSelectedModel(caps.defaultModel);
|
||||
setSelectedModel(caps.defaultModel ?? caps.models[0]?.id);
|
||||
setSelectedReasoning(caps.defaultReasoningEffort);
|
||||
});
|
||||
}, [api]);
|
||||
@@ -91,10 +91,10 @@ export function QuickPromptApp() {
|
||||
// Refresh capabilities in case models changed
|
||||
api.getCapabilities().then((caps) => {
|
||||
setCapabilities(caps);
|
||||
if (!selectedModel) setSelectedModel(caps.defaultModel);
|
||||
if (!selectedReasoning) setSelectedReasoning(caps.defaultReasoningEffort);
|
||||
setSelectedModel(caps.defaultModel ?? caps.models[0]?.id);
|
||||
setSelectedReasoning(caps.defaultReasoningEffort);
|
||||
});
|
||||
}, [api, selectedModel, selectedReasoning]);
|
||||
}, [api]);
|
||||
|
||||
const handleSend = useCallback(async (content: string) => {
|
||||
if (!content.trim() || phase === 'streaming') return;
|
||||
|
||||
Reference in New Issue
Block a user