dify - 💡(How to fix) Fix Using the Jinjia template in multi-turn conversations will modify the history of the conversation, thus causing the loss of context. [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
langgenius/dify#34952Fetched 2026-04-11 06:31:44
View on GitHub
Comments
0
Participants
1
Timeline
2
Reactions
1
Participants
Timeline (top)
labeled ×2
RAW_BUFFERClick to expand / collapse

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • 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, otherwise it will be closed.
  • 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

lastest version from https://cloud.dify.a

Cloud or Self Hosted

Cloud

Steps to reproduce

<img width="1739" height="229" alt="Image" src="https://github.com/user-attachments/assets/02433e1b-0063-461c-8a42-b129240af393" /> <img width="419" height="919" alt="Image" src="https://github.com/user-attachments/assets/c8712ff2-32ee-41d6-8e2a-c997a7070b82" /> <img width="408" height="1161" alt="Image" src="https://github.com/user-attachments/assets/2af2e620-44ca-47d9-b8b4-695cc106eb28" /> <img width="700" height="1003" alt="Image" src="https://github.com/user-attachments/assets/ff75cd94-0ac2-4daf-8da0-00d423220ceb" /> <img width="671" height="824" alt="Image" src="https://github.com/user-attachments/assets/5f7d6ca6-f3de-436b-b33a-c3a65575af76" />

✔️ Expected Behavior

Information should not be lost in multi-turn dialogues.

❌ Actual Behavior

The input rendered by the template was replaced with user input.

extent analysis

TL;DR

The issue can be mitigated by re-examining the template rendering process to prevent user input from overwriting the original information in multi-turn dialogues.

Guidance

  • Review the template rendering logic to ensure it correctly handles multi-turn dialogues and preserves the original information.
  • Verify that the issue is not caused by a misunderstanding of the intended behavior of the template rendering process.
  • Check for any recent changes to the template or dialogue handling code that may have introduced this issue.
  • Consider adding logging or debugging statements to track the flow of information and identify where the original data is being overwritten.

Example

No code snippet can be provided without more context about the specific template rendering process or dialogue handling code.

Notes

The root cause of the issue is unclear without more information about the code or the specific requirements of the template rendering process. Further investigation is needed to determine the best solution.

Recommendation

Apply workaround: Modify the template rendering process to preserve the original information in multi-turn dialogues, potentially by storing the original data separately or using a different rendering approach.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING