Support parent_message_id in service-api to recover from security interception failures #18252

Closed
opened 2026-02-21 19:45:24 -05:00 by yindo · 0 comments
Owner

Originally created by @xiaoge200 on GitHub (Sep 25, 2025).

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report, otherwise it will be closed.
  • Please do not modify this template :) and fill in all the required fields.

1. Is this request related to a challenge you're experiencing? Tell me about your story.

I created an advanced chat using Dify, with Tongyi Qwen as the LLM.
After enabling context, if a user inputs sensitive content, it will trigger the security mechanism of the LLM provider, resulting in a failed message.

Since the context is retained, all subsequent messages in the same conversation will also be blocked by the provider’s security mechanism, causing the entire conversation to become unusable.

Currently, the only workaround is to start a new conversation, which is not an ideal solution.

According to the solution provided on the web, using parent_message_id allows content to be regenerated when a failure occurs. However, this feature is not supported in service-api at the moment.

Expected Behavior

Support parent_message_id in service-api.

Allow regenerating content when a message fails due to provider-side security interception, instead of requiring a new conversation.

Current Workaround

Create a new conversation manually (not user-friendly).

2. Additional context or comments

No response

3. Can you help us with this feature?

  • I am interested in contributing to this feature.
Originally created by @xiaoge200 on GitHub (Sep 25, 2025). ### Self Checks - [x] I have read the [Contributing Guide](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) and [Language Policy](https://github.com/langgenius/dify/issues/1542). - [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, otherwise it will be closed. - [x] Please do not modify this template :) and fill in all the required fields. ### 1. Is this request related to a challenge you're experiencing? Tell me about your story. I created an advanced chat using Dify, with Tongyi Qwen as the LLM. After enabling context, if a user inputs sensitive content, it will trigger the security mechanism of the LLM provider, resulting in a failed message. Since the context is retained, all subsequent messages in the same conversation will also be blocked by the provider’s security mechanism, causing the entire conversation to become unusable. Currently, the only workaround is to start a new conversation, which is not an ideal solution. According to the solution provided on the web, using `parent_message_id` allows content to be regenerated when a failure occurs. However, this feature is not supported in service-api at the moment. Expected Behavior Support `parent_message_id` in service-api. Allow regenerating content when a message fails due to provider-side security interception, instead of requiring a new conversation. Current Workaround Create a new conversation manually (not user-friendly). ### 2. Additional context or comments _No response_ ### 3. Can you help us with this feature? - [x] I am interested in contributing to this feature.
yindo added the 💪 enhancement label 2026-02-21 19:45:24 -05:00
yindo closed this issue 2026-02-21 19:45:24 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#18252