The variable in the prompt-editor occasionally displays incorrectly. #5964

Closed
opened 2026-02-21 18:13:25 -05:00 by yindo · 1 comment
Owner

Originally created by @HiChen404 on GitHub (Oct 8, 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.8.3

Cloud or Self Hosted

Cloud

Steps to reproduce

Copy this variable string and then paste it repeatedly into the prompt-editor.

{{#sys.files#}}

https://github.com/user-attachments/assets/349886af-b67d-4e81-bf4a-6b833d564dc7

✔️ Expected Behavior

The variable should have the style of a custom node, rather than displaying as a plain string.

Actual Behavior

No response

Originally created by @HiChen404 on GitHub (Oct 8, 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.8.3 ### Cloud or Self Hosted Cloud ### Steps to reproduce Copy this variable string and then paste it repeatedly into the prompt-editor. ``` {{#sys.files#}} ``` https://github.com/user-attachments/assets/349886af-b67d-4e81-bf4a-6b833d564dc7 ### ✔️ Expected Behavior The variable should have the style of a custom node, rather than displaying as a plain string. ### ❌ Actual Behavior _No response_
yindo added the 🐞 bug label 2026-02-21 18:13:25 -05:00
yindo closed this issue 2026-02-21 18:13:25 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Oct 8, 2024):

There is a similar issue related to variable rendering in the prompt-editor. The issue titled "Abnormal display of node variables in workflow" was closed, but it suggested using the setWorkflowRunningData function to reset the workflow running data, which might help in re-rendering the nodes correctly [1].

Additionally, the decoratorTransform function in the prompt-editor module is responsible for transforming text nodes into custom nodes. It may fail under certain conditions, such as when no match is found or when matches do not start at the beginning of the text [2]. You might want to check if these conditions are affecting your case.

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Oct 8, 2024): <!-- Answer --> There is a similar issue related to variable rendering in the prompt-editor. The issue titled "[Abnormal display of node variables in workflow](https://github.com/langgenius/dify/issues/6276)" was closed, but it suggested using the `setWorkflowRunningData` function to reset the workflow running data, which might help in re-rendering the nodes correctly <sup>[[1]](https://github.com/langgenius/dify/issues/6276)</sup>. Additionally, the `decoratorTransform` function in the prompt-editor module is responsible for transforming text nodes into custom nodes. It may fail under certain conditions, such as when no match is found or when matches do not start at the beginning of the text <sup>[[2]](https://github.com/langgenius/dify/blob/main/web/app/components/base/prompt-editor/utils.ts)</sup>. You might want to check if these conditions are affecting your case. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#5964