Prompt variable reverts to text placeholder from graphical placeholder after page reload
Self Checks
- [X] This is only for bug report, if you would like to ask a quesion, please head to Discussions.
- [X] I have searched for existing issues search for existing issues, including closed ones.
- [X] I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
- [X] Pleas do not modify this template :) and fill in all the required fields.
Dify version
Version 0.6.5
Cloud or Self Hosted
Cloud
Steps to reproduce
Intermittent issue, only happens for some prompt variables
- Add variable to prompt - graphical placeholder is shown in the prompt builder
- Publish and reload the page. Graphical placeholder is now replaced by string placeholder. I have not tested if the variable inject still works
Other relevant information: In this specific case where I am experiencing the issue, it is a knowledge retrieval that I've assigned as a string to a variable, using the variable assigner node. I have not experienced this issue with other variables - also not other variables where I've assigned knowledge to string via assigner node.
✔️ Expected Behavior
All prompt variables are presented in a similar fashion in the prompt builder to ensure user understanding that the prompt is working and connected as expected
❌ Actual Behavior
Variable is presented differently in the prompt builder.
It sounds like the issue you're encountering with Dify version 0.6.5, where graphical placeholders revert to text placeholders after a page reload, is related to the lack of persistent state management for these placeholders. In web applications, state changes, such as the switch from a graphical to a text placeholder, are typically not preserved across page reloads unless explicitly saved to a persistent storage solution (like localStorage, sessionStorage, or a backend database) and then rehydrated upon the application's reload.
For your specific case with knowledge retrieval variables assigned as strings, it's important to note that handling these variables might differ from others, especially in how they're configured and managed within the application. This could explain why you're seeing this behavior with certain variables but not others.
Unfortunately, without a mechanism to save the state of these graphical representations to persistent storage and then reload them, the application defaults back to its initial state or a text placeholder upon page reload. This behavior suggests that implementing persistent state management for these graphical representations was either overlooked or not considered necessary in the current version of Dify.
While I can't provide a direct workaround or a temporary fix to prevent this reversion from happening after a page reload, understanding the cause might help in identifying potential solutions, such as manually saving the necessary state to local storage or requesting a feature update from the Dify development team to address this issue in future releases.
Details
Sources
- web/app/components/app/configuration/config-var/index.tsx
- en/features/workflow/nodes/knowledge-retrieval.md
- en/features/workflow/node/knowledge-retrieval.md
- web/app/components/workflow/nodes/knowledge-retrieval/use-config.ts
- web/app/components/workflow/nodes/knowledge-retrieval/default.ts
- en/features/prompt-engineering/README.md
- web/app/components/app/configuration/config/index.tsx
- web/config/index.ts
- web/app/components/app/configuration/config-prompt/advanced-prompt-input.tsx
About Dosu This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.
Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.
To continue the conversation, mention @dosu.
Recent update fixed this issue.