diff --git a/libs/react-client/src/types/file.ts b/libs/react-client/src/types/file.ts index af3fde1eba..9099a4163d 100644 --- a/libs/react-client/src/types/file.ts +++ b/libs/react-client/src/types/file.ts @@ -22,4 +22,5 @@ export interface IAsk { timeout: number; } & FileSpec & ActionSpec; + parentId?: string; } diff --git a/libs/react-client/src/useChatInteract.ts b/libs/react-client/src/useChatInteract.ts index ab646de970..b598093034 100644 --- a/libs/react-client/src/useChatInteract.ts +++ b/libs/react-client/src/useChatInteract.ts @@ -118,6 +118,7 @@ const useChatInteract = () => { const replyMessage = useCallback( (message: IStep) => { if (askUser) { + if (askUser.parentId) message.parentId = askUser.parentId; setMessages((oldMessages) => addMessage(oldMessages, message)); askUser.callback(message); } diff --git a/libs/react-client/src/useChatSession.ts b/libs/react-client/src/useChatSession.ts index 94f8d74eb5..9020847d2a 100644 --- a/libs/react-client/src/useChatSession.ts +++ b/libs/react-client/src/useChatSession.ts @@ -277,7 +277,7 @@ const useChatSession = () => { ); socket.on('ask', ({ msg, spec }, callback) => { - setAskUser({ spec, callback }); + setAskUser({ spec, callback, parentId: msg.parentId }); setMessages((oldMessages) => addMessage(oldMessages, msg)); setLoading(false);