From 90bc192176444d37a0e490477293569065182d53 Mon Sep 17 00:00:00 2001 From: ethan Date: Fri, 28 Nov 2025 14:55:34 +1100 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=A4=96=20fix:=20restore=20model=20fav?= =?UTF-8?q?orites=20in=20ChatInput?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The ORPC migration PR accidentally removed the model favorites integration from ChatInput. Restored: - defaultModel and setDefaultModel from useModelLRU() - useEffect to reset model to default when entering creation mode - defaultModel and onSetDefaultModel props passed to ModelSelector --- src/browser/components/ChatInput/index.tsx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/browser/components/ChatInput/index.tsx b/src/browser/components/ChatInput/index.tsx index 57d8db3d0..a0698ccb6 100644 --- a/src/browser/components/ChatInput/index.tsx +++ b/src/browser/components/ChatInput/index.tsx @@ -140,7 +140,7 @@ export const ChatInput: React.FC = (props) => { const inputRef = useRef(null); const modelSelectorRef = useRef(null); const [mode, setMode] = useMode(); - const { recentModels, addModel, evictModel } = useModelLRU(); + const { recentModels, addModel, evictModel, defaultModel, setDefaultModel } = useModelLRU(); const commandListId = useId(); const telemetry = useTelemetry(); const [vimEnabled, setVimEnabled] = usePersistedState(VIM_ENABLED_KEY, false, { @@ -178,6 +178,16 @@ export const ChatInput: React.FC = (props) => { [storageKeys.modelKey, addModel] ); + + // When entering creation mode (or when the default model changes), reset the + // project-scoped model to the explicit default so manual picks don't bleed + // into subsequent creation flows. + useEffect(() => { + if (variant === "creation" && defaultModel) { + updatePersistedState(storageKeys.modelKey, defaultModel); + } + }, [variant, defaultModel, storageKeys.modelKey]); + // Creation-specific state (hook always called, but only used when variant === "creation") // This avoids conditional hook calls which violate React rules const creationState = useCreationWorkspace( @@ -972,6 +982,8 @@ export const ChatInput: React.FC = (props) => { recentModels={recentModels} onRemoveModel={evictModel} onComplete={() => inputRef.current?.focus()} + defaultModel={defaultModel} + onSetDefaultModel={setDefaultModel} /> ? From d4afd15c37c206eae6d696e4a3cd1ba85401e759 Mon Sep 17 00:00:00 2001 From: ethan Date: Fri, 28 Nov 2025 14:59:49 +1100 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=A4=96=20fix:=20restore=20model=20fav?= =?UTF-8?q?orites=20in=20ChatInput?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The ORPC migration PR accidentally removed the model favorites integration from ChatInput. Restored: - defaultModel and setDefaultModel from useModelLRU() - useEffect to reset model to default when entering creation mode - defaultModel and onSetDefaultModel props passed to ModelSelector The ModelSelector.stories.tsx WithDefaultModel story documents the feature. --- src/browser/components/ChatInput/index.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/browser/components/ChatInput/index.tsx b/src/browser/components/ChatInput/index.tsx index a0698ccb6..95554265e 100644 --- a/src/browser/components/ChatInput/index.tsx +++ b/src/browser/components/ChatInput/index.tsx @@ -178,7 +178,6 @@ export const ChatInput: React.FC = (props) => { [storageKeys.modelKey, addModel] ); - // When entering creation mode (or when the default model changes), reset the // project-scoped model to the explicit default so manual picks don't bleed // into subsequent creation flows.