fix(FN-2863): retry quick chat session init for default model

- Allow session initialization to retry when the same target key is selected but no active session exists
- Gate duplicate-init short-circuit behind activeSession/sessionsLoading so model-mode startup can recover
- Expand the effect dependency list to track session readiness inputs used by the retry guard
This commit is contained in:
Fusion
2026-04-28 08:49:32 -07:00
committed by gsxdsm
parent dbc5d9d15c
commit 6f06214ce6

View File

@@ -832,7 +832,11 @@ export function QuickChatFAB({
return;
}
if (sessionTargetKey === prevSessionTargetRef.current) {
const shouldRetrySessionInit = sessionTargetKey === prevSessionTargetRef.current
&& !activeSession
&& !sessionsLoading;
if (sessionTargetKey === prevSessionTargetRef.current && !shouldRetrySessionInit) {
return;
}
@@ -846,7 +850,17 @@ export function QuickChatFAB({
if (chatMode === "agent" && selectedAgentId) {
void switchSession(selectedAgentId);
}
}, [isOpen, chatMode, parsedModelSelection, selectedAgentId, sessionTargetKey, startModelChat, switchSession]);
}, [
isOpen,
chatMode,
parsedModelSelection,
selectedAgentId,
sessionTargetKey,
activeSession,
sessionsLoading,
startModelChat,
switchSession,
]);
useEffect(() => {
if (isOpen) {