If input contains specific content when testing a single block, the test do not work #5833

Closed
opened 2026-02-21 18:12:48 -05:00 by yindo · 7 comments
Owner

Originally created by @cowcomic on GitHub (Sep 27, 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.2

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

create a block test
input as "=1 group by"
the pattern of the string as "={num}{space}group{space}by{space}"
start run
it seems to be running, but not a really running. The result is still the result of the last valid input

image

✔️ Expected Behavior

The result is still the result of the last valid input

Actual Behavior

No response

Originally created by @cowcomic on GitHub (Sep 27, 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.2 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce create a block test input as "=1 group by" the pattern of the string as "={num}{space}group{space}by{space}" start run it seems to be running, but not a really running. The result is still the result of the last valid input ![image](https://github.com/user-attachments/assets/74f06534-394f-4a9b-9b75-ae23edd11c05) ### ✔️ Expected Behavior The result is still the result of the last valid input ### ❌ Actual Behavior _No response_
yindo added the 🐞 bug label 2026-02-21 18:12:48 -05:00
yindo closed this issue 2026-02-21 18:12:48 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Sep 27, 2024):

The issue you're encountering with the block test not working when the input contains specific content like =1 group by is likely related to how the input is tokenized and classified. The tokenizer in the pgsql.js file is designed to handle such inputs by classifying components as operators, numbers, and keywords. Specifically, = is classified as an operator, 1 as a number, and group and by as keywords [1].

However, the behavior you're describing, where the test seems to run but returns the result of the last valid input, suggests there might be a caching mechanism or an issue with how the test results are updated. According to the documentation, Dify updates the test results when you enter common user questions in the Source Text input box and click Test. There is no mention of conditions under which Dify might reuse previous results [2].

To address this issue, you might want to check if there are any caching mechanisms in place that could be affecting the test results. Additionally, ensure that the input is correctly tokenized and classified according to the defined rules in the pgsql.js file. If the problem persists, it might be worth investigating further into the specific implementation details of the block test mechanism and any potential caching behavior.

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Sep 27, 2024): <!-- Answer --> The issue you're encountering with the block test not working when the input contains specific content like `=1 group by` is likely related to how the input is tokenized and classified. The tokenizer in the `pgsql.js` file is designed to handle such inputs by classifying components as operators, numbers, and keywords. Specifically, `=` is classified as an operator, `1` as a number, and `group` and `by` as keywords <sup>[[1]](https://github.com/langgenius/dify/blob/main/web/public/vs/basic-languages/pgsql/pgsql.js)</sup>. However, the behavior you're describing, where the test seems to run but returns the result of the last valid input, suggests there might be a caching mechanism or an issue with how the test results are updated. According to the documentation, Dify updates the test results when you enter common user questions in the **Source Text** input box and click **Test**. There is no mention of conditions under which Dify might reuse previous results <sup>[[2]](https://github.com/langgenius/dify-docs/blob/main/en/guides/knowledge-base/retrieval-test-and-citation.md)</sup>. To address this issue, you might want to check if there are any caching mechanisms in place that could be affecting the test results. Additionally, ensure that the input is correctly tokenized and classified according to the defined rules in the `pgsql.js` file. If the problem persists, it might be worth investigating further into the specific implementation details of the block test mechanism and any potential caching behavior. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
Author
Owner

@Wu-Jiayang commented on GitHub (Sep 30, 2024):

You can try this:
https://github.com/langgenius/dify/pull/7955

@Wu-Jiayang commented on GitHub (Sep 30, 2024): You can try this: https://github.com/langgenius/dify/pull/7955
Author
Owner

@Wu-Jiayang commented on GitHub (Sep 30, 2024):

This can solve your problem

@Wu-Jiayang commented on GitHub (Sep 30, 2024): This can solve your problem
Author
Owner

@cowcomic commented on GitHub (Oct 10, 2024):

This can solve your problem

any plan for merge it to a version?

@cowcomic commented on GitHub (Oct 10, 2024): > This can solve your problem any plan for merge it to a version?
Author
Owner

@Wu-Jiayang commented on GitHub (Oct 10, 2024):

This can solve your problem

any plan for merge it to a version?

I opened a PR, but I'm not sure when they will merge it.

@Wu-Jiayang commented on GitHub (Oct 10, 2024): > > This can solve your problem > > any plan for merge it to a version? I opened a PR, but I'm not sure when they will merge it.
Author
Owner

@Wu-Jiayang commented on GitHub (Oct 10, 2024):

Maybe they will merge it only if we give them a push.

@Wu-Jiayang commented on GitHub (Oct 10, 2024): Maybe they will merge it only if we give them a push.
Author
Owner

@dosubot[bot] commented on GitHub (Nov 10, 2024):

Hi, @cowcomic. I'm Dosu, and I'm helping the Dify team manage their backlog. I'm marking this issue as stale.

Issue Summary:

  • You reported a bug in Dify version 0.8.2 where specific input patterns cause incorrect test outputs.
  • I suggested the issue might be due to input tokenization and caching mechanisms.
  • @Wu-Jiayang proposed a solution with PR #7955 but mentioned uncertainty about the merge timeline.
  • You inquired about when the fix would be merged into a release version.

Next Steps:

  • Please let us know if this issue is still relevant to the latest version of Dify. If so, you can keep the discussion open by commenting here.
  • If there is no further activity, this issue will be automatically closed in 15 days.

Thank you for your understanding and contribution!

@dosubot[bot] commented on GitHub (Nov 10, 2024): Hi, @cowcomic. I'm [Dosu](https://dosu.dev), and I'm helping the Dify team manage their backlog. I'm marking this issue as stale. **Issue Summary:** - You reported a bug in Dify version 0.8.2 where specific input patterns cause incorrect test outputs. - I suggested the issue might be due to input tokenization and caching mechanisms. - @Wu-Jiayang proposed a solution with PR #7955 but mentioned uncertainty about the merge timeline. - You inquired about when the fix would be merged into a release version. **Next Steps:** - Please let us know if this issue is still relevant to the latest version of Dify. If so, you can keep the discussion open by commenting here. - If there is no further activity, this issue will be automatically closed in 15 days. Thank you for your understanding and contribution!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#5833