can't auto generate conversation name,always is New conversation #4906

Closed
opened 2026-02-21 18:08:33 -05:00 by yindo · 6 comments
Owner

Originally created by @Lyeluo on GitHub (Aug 6, 2024).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

0.6.15

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

when i use workflow for chat api to create a conversation ,whether i set auto_generate_name true or false . when i get conversations histroy , got conversation name is "New conversation". Is this a bug?
image

✔️ Expected Behavior

get model generated conversation name

Actual Behavior

No response

Originally created by @Lyeluo on GitHub (Aug 6, 2024). ### Self Checks - [X] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [X] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [X] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [X] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [X] Please do not modify this template :) and fill in all the required fields. ### Dify version 0.6.15 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce when i use workflow for chat api to create a conversation ,whether i set **auto_generate_name** true or false . when i get conversations histroy , got conversation name is "New conversation". Is this a bug? ![image](https://github.com/user-attachments/assets/8312648b-057f-438f-8b80-ce9f0c4ddde3) ### ✔️ Expected Behavior get model generated conversation name ### ❌ Actual Behavior _No response_
yindo added the 🐞 bug label 2026-02-21 18:08:33 -05:00
yindo closed this issue 2026-02-21 18:08:33 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Aug 6, 2024):

@Lyeluo Hello there! I'm here to help you with bugs, questions, and becoming a contributor. Let's squash those bugs together! 😊

Yes, it appears to be a bug in Dify version 0.6.15. The auto_generate_name parameter in the chat API should control whether the conversation name is auto-generated. If auto_generate_name is set to false, the conversation name should not default to "New conversation". However, if the conversation name is always set to "New conversation" regardless of the auto_generate_name parameter setting, this behavior is inconsistent with the documented functionality [1][2][3].

There have been updates in version 0.6.16 that address issues related to conversation name generation. The _generate_conversation_name method in the MessageCycleManage class includes logic to automatically generate a conversation name if the auto_generate_conversation_name flag is set to True and it is the first message in the conversation [3].

Updating to version 0.6.16 should resolve this issue.

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Aug 6, 2024): <!-- Greeting --> @Lyeluo Hello there! I'm here to help you with bugs, questions, and becoming a contributor. Let's squash those bugs together! 😊 <!-- Answer --> Yes, it appears to be a bug in Dify version 0.6.15. The `auto_generate_name` parameter in the chat API should control whether the conversation name is auto-generated. If `auto_generate_name` is set to `false`, the conversation name should not default to "New conversation". However, if the conversation name is always set to "New conversation" regardless of the `auto_generate_name` parameter setting, this behavior is inconsistent with the documented functionality <sup>[[1]](https://github.com/langgenius/dify/blob/main/web/app/components/develop/template/template_chat.en.mdx)</sup><sup>[[2]](https://github.com/langgenius/dify/blob/main/web/app/components/develop/template/template_advanced_chat.en.mdx)</sup><sup>[[3]](https://github.com/langgenius/dify/blob/main/api/core/app/task_pipeline/message_cycle_manage.py)</sup>. There have been updates in version 0.6.16 that address issues related to conversation name generation. The `_generate_conversation_name` method in the `MessageCycleManage` class includes logic to automatically generate a conversation name if the `auto_generate_conversation_name` flag is set to `True` and it is the first message in the conversation <sup>[[3]](https://github.com/langgenius/dify/blob/main/api/core/app/task_pipeline/message_cycle_manage.py)</sup>. Updating to version 0.6.16 should resolve this issue. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
Author
Owner

@crazywoola commented on GitHub (Aug 6, 2024):

I think this is a deprecated parameter here, we found it will make the whole conversation slower and consume more tokens.
Please use this api /conversations/:conversation_id/name instead. We will phase out this parameter in the future. :)

@crazywoola commented on GitHub (Aug 6, 2024): I think this is a deprecated parameter here, we found it will make the whole conversation slower and consume more tokens. Please use this api `/conversations/:conversation_id/name` instead. We will phase out this parameter in the future. :)
Author
Owner

@Lyeluo commented on GitHub (Aug 6, 2024):

i got it,thx~

@Lyeluo commented on GitHub (Aug 6, 2024): i got it,thx~
Author
Owner

@anjingyong commented on GitHub (Mar 27, 2025):

i use 1.0.0 version has this bugs,use this api/conversations/:conversation_id/name with parameter "auto_generate": true,

@anjingyong commented on GitHub (Mar 27, 2025): i use 1.0.0 version has this bugs,use this api/conversations/:conversation_id/name with parameter "auto_generate": true,
Author
Owner

@yjing86 commented on GitHub (Apr 2, 2025):

This bug still exists to this day in 1.0.1 version

@yjing86 commented on GitHub (Apr 2, 2025): This bug still exists to this day in 1.0.1 version
Author
Owner

@hlwz5735 commented on GitHub (May 8, 2025):

This is because you can't use reasoning LLM model(like DeepSeek-R1). The auto rename feature will invoke system default LLM and expect that it will return a JSON string. Because Reasoning LLM will append <think>...</think> blocks, Dify can't match the output with current regxp.

The relevant code is located at: api/core/llm_generator/llm_generator.py,line 56:

        answer = cast(str, response.message.content)
        cleaned_answer = re.sub(r"^.*(\{.*\}).*$", r"\1", answer, flags=re.DOTALL)
        if cleaned_answer is None:
            return ""
        result_dict = json.loads(cleaned_answer)
        answer = result_dict["Your Output"]
        name = answer.strip()

I think we can solve this problem by cutting the string to get a clean substring. Such as:

if ('</think>' in answer):
  answer = answer.split('</think>')[-1] # just for demostration, not robbust

cleaned_answer = re.sub(r"^.*(\{.*\}).*$", r"\1", answer, flags=re.DOTALL)
@hlwz5735 commented on GitHub (May 8, 2025): This is because you can't use reasoning LLM model(like DeepSeek-R1). The auto rename feature will invoke system default LLM and expect that it will return a JSON string. Because Reasoning LLM will append `<think>...</think>` blocks, Dify can't match the output with current regxp. The relevant code is located at: `api/core/llm_generator/llm_generator.py`,line 56: ```python answer = cast(str, response.message.content) cleaned_answer = re.sub(r"^.*(\{.*\}).*$", r"\1", answer, flags=re.DOTALL) if cleaned_answer is None: return "" result_dict = json.loads(cleaned_answer) answer = result_dict["Your Output"] name = answer.strip() ``` I think we can solve this problem by cutting the string to get a clean substring. Such as: ```python if ('</think>' in answer): answer = answer.split('</think>')[-1] # just for demostration, not robbust cleaned_answer = re.sub(r"^.*(\{.*\}).*$", r"\1", answer, flags=re.DOTALL) ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#4906