Fix model picker clearing reasoning effort and fast mode options

Preserve existing modelSelection.options when the user switches models
within the same provider. Previously, onProviderModelSelect constructed
a new ModelSelection with only provider and model, silently dropping
any configured reasoning effort or fast mode settings.
This commit is contained in:
Cursor Agent committed 2026-03-24 18:20:28 +00:00
1 parent 01358d1006
commit 569dd7bcab
1 file changed
+6 -1
+6 -1
View File
@@ -3135,10 +3135,14 @@ export default function ChatView({ threadId }: ChatViewProps) {
return;
}
const resolvedModel = resolveAppModelSelection(provider, customModelsByProvider, model);
const existingOptions = composerDraft.modelSelection?.options;
const preserveOptions =
existingOptions !== undefined && composerDraft.modelSelection?.provider === provider;
const nextModelSelection: ModelSelection = {
provider,
model: resolvedModel,
};
...(preserveOptions ? { options: existingOptions } : {}),
} as ModelSelection;
setComposerDraftModelSelection(activeThread.id, nextModelSelection);
setStickyComposerModelSelection(nextModelSelection);
scheduleComposerFocus();
@@ -3150,6 +3154,7 @@ export default function ChatView({ threadId }: ChatViewProps) {
setComposerDraftModelSelection,
setStickyComposerModelSelection,
customModelsByProvider,
composerDraft.modelSelection,
],
);
const setPromptFromTraits = useCallback(