The parent_message_id is missing when retrieving conversation history via the API. #13244

Closed
opened 2026-02-21 19:11:14 -05:00 by yindo · 6 comments
Owner

Originally created by @zhangdachen on GitHub (Apr 23, 2025).

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

1.1.3

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

When I use Dify's API interface to implement a conversation, and upon refreshing and asking again to retrieve the conversation history messages, the parent_message_id is not returned (the interface is http://192.168.1.92/v1/messages?user=abc-123&conversation_id=). However, when I captured the packets in the Dify program, the response included this parent_message_id.

Image

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @zhangdachen on GitHub (Apr 23, 2025). ### 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 1.1.3 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce When I use Dify's API interface to implement a conversation, and upon refreshing and asking again to retrieve the conversation history messages, the parent_message_id is not returned (the interface is http://192.168.1.92/v1/messages?user=abc-123&conversation_id=). However, when I captured the packets in the Dify program, the response included this parent_message_id. ![Image](https://github.com/user-attachments/assets/e086a568-be7a-411c-a994-679c40999dbc) ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo added the 🐞 bug label 2026-02-21 19:11:14 -05:00
yindo closed this issue 2026-02-21 19:11:14 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Apr 23, 2025):

Hello @zhangdachen! I'm Dosu, your friendly bot here to help you tackle bugs, answer questions, and navigate the world of contributions. I'm here while you wait for a human maintainer, so let's get started! 🚀

There are a few similar discussions related to the parent_message_id in Dify's API:

  1. How to implement message retry through service-api? There is no parent_message_id field - This discussion is still open and addresses the absence of the parent_message_id field in the service API [1].

  2. The latest version of dify. Does the chat messages API still support the parent_cessage_id parameter. Based on the already replied answer, regenerate the answer - This discussion is also open and discusses the support for the parent_message_id parameter in the chat messages API [2].

Regarding your issue, it's important to note that the parent_message_id is not supported in the v1/chat-messages endpoint for the service API in Dify version 0.15.3. It is intended for internal chat API message regeneration, and for the service API, it must be set to UUID_NIL to ensure forward compatibility. This means that the parent_message_id is not included in the API response for conversation history in the service API [2][3].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot[bot] commented on GitHub (Apr 23, 2025): <!-- Greeting --> Hello @zhangdachen! I'm [Dosu](https://dosu.dev), your friendly bot here to help you tackle bugs, answer questions, and navigate the world of contributions. I'm here while you wait for a human maintainer, so let's get started! 🚀 <!-- Answer --> There are a few similar discussions related to the `parent_message_id` in Dify's API: 1. [How to implement message retry through service-api? There is no parent_message_id field](https://github.com/langgenius/dify/discussions/18081) - This discussion is still open and addresses the absence of the `parent_message_id` field in the service API <sup>[[1]](https://github.com/langgenius/dify/discussions/18081)</sup>. 2. [The latest version of dify. Does the chat messages API still support the parent_cessage_id parameter. Based on the already replied answer, regenerate the answer](https://github.com/langgenius/dify/discussions/13733) - This discussion is also open and discusses the support for the `parent_message_id` parameter in the chat messages API <sup>[[2]](https://github.com/langgenius/dify/discussions/13733)</sup>. Regarding your issue, it's important to note that the `parent_message_id` is not supported in the v1/chat-messages endpoint for the service API in Dify version 0.15.3. It is intended for internal chat API message regeneration, and for the service API, it must be set to `UUID_NIL` to ensure forward compatibility. This means that the `parent_message_id` is not included in the API response for conversation history in the service API <sup>[[2]](https://github.com/langgenius/dify/discussions/13733)</sup><sup>[[3]](https://github.com/langgenius/dify/issues/18076)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/00fcd719-ba6c-487b-9b33-0569d88992aa?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/00fcd719-ba6c-487b-9b33-0569d88992aa?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/00fcd719-ba6c-487b-9b33-0569d88992aa?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/00fcd719-ba6c-487b-9b33-0569d88992aa?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/00fcd719-ba6c-487b-9b33-0569d88992aa?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/00fcd719-ba6c-487b-9b33-0569d88992aa?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/00fcd719-ba6c-487b-9b33-0569d88992aa?feedback_type=other)</sup>
Author
Owner

@ZombieBlue commented on GitHub (Apr 23, 2025):

I use the cloud service API, it return long 0 string , not real message id. While , the cloud dify version is 1.3.0

Image

@ZombieBlue commented on GitHub (Apr 23, 2025): I use the cloud service API, it return long 0 string , not real message id. While , the cloud dify version is 1.3.0 ![Image](https://github.com/user-attachments/assets/30936df6-a7db-4a82-ba19-84bcdf91896e)
Author
Owner

@zhangdachen commented on GitHub (Apr 23, 2025):

yes ,me too.

@zhangdachen commented on GitHub (Apr 23, 2025): yes ,me too.
Author
Owner

@ZombieBlue commented on GitHub (Apr 23, 2025):

@zhangdachen I think I have find out the reason , this is not an error when calling get history messages, dify team set its value is NIL for the considering of forward compatibility .

Image

@ZombieBlue commented on GitHub (Apr 23, 2025): @zhangdachen I think I have find out the reason , this is not an error when calling get history messages, dify team set its value is NIL for the considering of forward compatibility . ![Image](https://github.com/user-attachments/assets/404eb192-0953-41a4-872c-629abee36bd3)
Author
Owner

@zhangdachen commented on GitHub (Apr 24, 2025):

@ZombieBlue oh i know. They did it on purpose.

@zhangdachen commented on GitHub (Apr 24, 2025): @ZombieBlue oh i know. They did it on purpose.
Author
Owner

@zhangxinGithub commented on GitHub (May 28, 2025):

It doesn't seem like a big deal. Why hasn't it been fixed yet

@zhangxinGithub commented on GitHub (May 28, 2025): It doesn't seem like a big deal. Why hasn't it been fixed yet
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#13244