Variables are not recognized. #4586

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

Originally created by @sca-KenshiYoshida on GitHub (Jul 12, 2024).

Originally assigned to: @zxhlyh on GitHub.

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).
  • 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

0.6.13

Cloud or Self Hosted

Cloud

Steps to reproduce

The variable "system_prompt" was defined in the start node and used in the SYSTEM column of the LLM node.

However, it was not available in other nodes. When this variable is selected, the node where it is defined is not displayed.

All words that start with "syst " are not available. Are there any other similar characters?

スクリーンショット 2024-07-12 16 26 07

✔️ Expected Behavior

Variables with the initials "syst" can be used.

Actual Behavior

Variables with the initials "syst" could not be used.

Originally created by @sca-KenshiYoshida on GitHub (Jul 12, 2024). Originally assigned to: @zxhlyh on GitHub. ### 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] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [X] Please do not modify this template :) and fill in all the required fields. ### Dify version 0.6.13 ### Cloud or Self Hosted Cloud ### Steps to reproduce The variable "system_prompt" was defined in the start node and used in the SYSTEM column of the LLM node. However, it was not available in other nodes. When this variable is selected, the node where it is defined is not displayed. All words that start with "syst " are not available. Are there any other similar characters? <img width="394" alt="スクリーンショット 2024-07-12 16 26 07" src="https://github.com/user-attachments/assets/e83fcb46-9a9e-40be-a070-ac696be30b86"> ### ✔️ Expected Behavior Variables with the initials "syst" can be used. ### ❌ Actual Behavior Variables with the initials "syst" could not be used.
yindo added the 🐞 bug label 2026-02-21 18:07:07 -05:00
yindo closed this issue 2026-02-21 18:07:08 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Jul 12, 2024):

Hello @sca-KenshiYoshida! I'm here to help you with any issues or questions you have. I can assist with bug fixes, answer your queries, and guide you on how to contribute. Let's work together to resolve any issues you're facing.

The issue you're encountering is due to a specific pattern in the Dify codebase that filters out variables starting with "sys". The function isSystemVar checks if the variable name starts with "sys", which would exclude variables starting with "syst" as they match this condition.

Here is the relevant code snippet:

export const isSystemVar = (valueSelector: ValueSelector) => {
  return valueSelector[0] === 'sys' || valueSelector[1] === 'sys'
}

This function returns true if the first or second element of the valueSelector array is "sys", causing variables like "systeeeeee" to be treated as system variables and thus not recognized as user-defined variables [1].

To resolve this issue, you should avoid using variable names that start with "sys" or "syst". Consider using a different prefix for your variables to ensure they are recognized correctly.

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Jul 12, 2024): <!-- Greeting --> Hello @sca-KenshiYoshida! I'm here to help you with any issues or questions you have. I can assist with bug fixes, answer your queries, and guide you on how to contribute. Let's work together to resolve any issues you're facing. <!-- Answer --> The issue you're encountering is due to a specific pattern in the Dify codebase that filters out variables starting with "sys". The function `isSystemVar` checks if the variable name starts with "sys", which would exclude variables starting with "syst" as they match this condition. Here is the relevant code snippet: ```ts export const isSystemVar = (valueSelector: ValueSelector) => { return valueSelector[0] === 'sys' || valueSelector[1] === 'sys' } ``` This function returns `true` if the first or second element of the `valueSelector` array is "sys", causing variables like "systeeeeee" to be treated as system variables and thus not recognized as user-defined variables <sup>[[1]](https://github.com/langgenius/dify/blob/main/web/app/components/workflow/nodes/_base/components/variable/utils.ts)</sup>. To resolve this issue, you should avoid using variable names that start with "sys" or "syst". Consider using a different prefix for your variables to ensure they are recognized correctly. <!-- 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#4586