Skip to content

Commit 98f3877

Browse files
committed
fix: reset model to default when entering creation mode
1 parent c0727f3 commit 98f3877

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/browser/components/ChatInput/index.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,15 @@ export const ChatInput: React.FC<ChatInputProps> = (props) => {
176176
[storageKeys.modelKey, addModel]
177177
);
178178

179+
// When entering creation mode, always reset the model selection to the global default.
180+
// We don't want manual selections to persist to subsequent workspace creations.
181+
useEffect(() => {
182+
if (variant === "creation" && defaultModel) {
183+
updatePersistedState(storageKeys.modelKey, defaultModel);
184+
}
185+
// eslint-disable-next-line react-hooks/exhaustive-deps
186+
}, []); // Run once on mount
187+
179188
// Creation-specific state (hook always called, but only used when variant === "creation")
180189
// This avoids conditional hook calls which violate React rules
181190
const creationState = useCreationWorkspace(

0 commit comments

Comments
 (0)