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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user