diff --git a/jam-ui/src/components/client/chat/JKChatMessageList.js b/jam-ui/src/components/client/chat/JKChatMessageList.js index 98ce9a1c1..7e401968a 100644 --- a/jam-ui/src/components/client/chat/JKChatMessageList.js +++ b/jam-ui/src/components/client/chat/JKChatMessageList.js @@ -131,9 +131,14 @@ const JKChatMessageList = () => { */ useEffect(() => { if (activeChannel && fetchStatus !== 'loading' && fetchStatus !== 'succeeded') { - dispatch(fetchChatHistory({ channel: activeChannel })); + // For session chat, activeChannel is the sessionId + // Pass sessionId so the thunk knows to fetch 'session' channel type + dispatch(fetchChatHistory({ + channel: activeChannel, + sessionId: sessionId || activeChannel // Use sessionId from Redux, fallback to activeChannel + })); } - }, [dispatch, activeChannel, fetchStatus]); + }, [dispatch, activeChannel, sessionId, fetchStatus]); // Loading state if (fetchStatus === 'loading' && messages.length === 0) {