dify icon indicating copy to clipboard operation
dify copied to clipboard

Multiple Models View - Removing one Model, resets chat

Open perzeuss opened this issue 1 year ago • 2 comments

Self Checks

Dify version

0.5.2

Cloud or Self Hosted

Cloud, Self Hosted (Docker)

Steps to reproduce

  • Create an Assistant App

  • Go to Model Settings and click on "Debug as Multiple Models"

  • Add up tp 4/4 models, select a model e.g. gpt-3.5-turbo

  • Send a chat message so that all 4 models start generating grafik

  • After all are done, delete the model at position # 3 grafik

✔️ Expected Behavior

Chat history for # 1, # 2 and # 4 stays visible. Chats do not reset. grafik

❌ Actual Behavior

Chat history for all remaining 3 chat windows are empty. Chat have been reset (at least it looks like that in the UI) grafik

perzeuss avatar Jan 26 '24 16:01 perzeuss

🤖

Hello again, @perzeuss! Always a pleasure to see familiar faces around here. I hope you're doing great. Let's dive into this issue.

Thank you for the detailed report, perzeuss. It seems like the issue you're experiencing is related to how the chat history and model deletion are handled in the dify codebase.

The chat history in dify is managed through a series of API calls that fetch and update the chat data. The chat data is stored on the server and is fetched as needed by the client application. You can find more details about these functions in the web/service/log.ts file.

As for the deletion of a model, it's handled through the onRemove function that is passed as a prop to the DeleteConfirmModal component. This function is called when the user clicks on the "Sure" button in the delete confirmation modal. The relevant code can be found in the web/app/components/base/modal/delete-confirm-modal/index.tsx file.

Based on your report, it seems like the chat history is being reset when a model is deleted. This could be due to the onRemove function not properly handling the deletion of a model in a way that preserves the chat history. Unfortunately, without the actual implementation of the onRemove function, it's hard to say for sure what's causing this issue.

I would recommend checking the implementation of the onRemove function and see if it's doing anything that could potentially reset the chat history. Also, check the functions related to fetching and updating the chat history to see if they're being called correctly after a model is deleted.

If you're still having trouble, please provide more details about the implementation of the onRemove function and how the chat history is being fetched and updated. This will help us better understand the issue and provide a more accurate solution.

Sources


This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

If you want to continue the conversation, start your reply with @dosu-bot.

dosubot[bot] avatar Jan 26 '24 16:01 dosubot[bot]

Maybe it's related to the window resize. If the window resizes, it will regenerate the conversation as well even it's a single debug area. @zxhlyh

crazywoola avatar Jan 27 '24 06:01 crazywoola

fixed. @perzeuss

zxhlyh avatar Jan 30 '24 08:01 zxhlyh