Regarding the issue of PR # 7955 requiring variable queries from the database every time #14077

Closed
opened 2026-02-21 19:15:26 -05:00 by yindo · 2 comments
Owner

Originally created by @wxyz520 on GitHub (May 21, 2025).

Originally assigned to: @crazywoola on GitHub.

Self Checks

  • 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.

1. Is this request related to a challenge you're experiencing? Tell me about your story.

Dify version

1.3.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

First request

Image

Second request (carrying conversation_id)

Image

✔️ Expected Behavior

request successful

Actual Behavior

{
"code": "invalid_param",
"message": "is_test is required in input form",
"status": 400
}

2. Additional context or comments

I don't think this is a good update. If conversion_id has a value, then not checking the content of the inputs is a good feature. If the inputs have not been changed, passing them in every time to chanflow/chatbot has no practical meaning. In practical applications, my project will query a large number of parameters and pass them into chanflow during the first conversation, but in subsequent conversations, it will no longer query and will directly use conversion_id for the conversation. The v1.3.1 change requires querying these parameters and passing them into chanflow every time in the specific code, resulting in a particularly slow response for each conversation.

3. Can you help us with this feature?

  • I am interested in contributing to this feature.
Originally created by @wxyz520 on GitHub (May 21, 2025). Originally assigned to: @crazywoola on GitHub. ### Self Checks - [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. ### 1. Is this request related to a challenge you're experiencing? Tell me about your story. ### Dify version 1.3.1 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce #### First request ![Image](https://github.com/user-attachments/assets/d892d1de-a82f-4334-afe9-93b7e9b3586e) #### Second request (carrying conversation_id) ![Image](https://github.com/user-attachments/assets/0e4c762f-0287-45b2-aeeb-7bb989b4119e) ### ✔️ Expected Behavior request successful ### ❌ Actual Behavior { "code": "invalid_param", "message": "is_test is required in input form", "status": 400 } ### 2. Additional context or comments I don't think this is a good update. If conversion_id has a value, then not checking the content of the inputs is a good feature. If the inputs have not been changed, passing them in every time to chanflow/chatbot has no practical meaning. In practical applications, my project will query a large number of parameters and pass them into chanflow during the first conversation, but in subsequent conversations, it will no longer query and will directly use conversion_id for the conversation. The v1.3.1 change requires querying these parameters and passing them into chanflow every time in the specific code, resulting in a particularly slow response for each conversation. ### 3. Can you help us with this feature? - [ ] I am interested in contributing to this feature.
yindo added the 💪 enhancement label 2026-02-21 19:15:26 -05:00
yindo closed this issue 2026-02-21 19:15:26 -05:00
Author
Owner

@wxyz520 commented on GitHub (May 21, 2025):

Optionally, when conversion_id has been passed in, if the inputs have a value, replace the original parameter value. If not, do not check the inputs.

@wxyz520 commented on GitHub (May 21, 2025): Optionally, when conversion_id has been passed in, if the inputs have a value, replace the original parameter value. If not, do not check the inputs.
Author
Owner

@dosubot[bot] commented on GitHub (May 21, 2025):

Your suggestion—to only require input validation (such as the is_test parameter) when new inputs are provided, and otherwise use the existing conversation context when conversation_id is present—aligns with best practices for efficient session management. However, based on the available code and documentation, there is currently no explicit logic in Dify that implements this conditional behavior.

The ParameterExtractorNode is responsible for extracting and validating parameters, but there is no documentation or code comment explaining why is_test is always required, even when conversation_id is present and inputs have not changed. The current implementation appears to enforce is_test as a required parameter for every request, regardless of whether conversation_id is provided or not. This can lead to unnecessary repeated parameter queries and slower response times, as you've described. Recent changes in the repository (such as new tables and indexes for conversation variables) do not address this specific requirement either [source].

If you are interested in contributing a solution, you may want to focus on the logic in the ParameterExtractorNode and related workflow execution code. The goal would be to adjust the validation so that:

  • If conversation_id is present and no new inputs are provided, the system should reuse the previous parameters without requiring is_test.
  • If new inputs are provided, they should replace the original parameter values as you suggested.

There are no existing issues or discussions in the repository that directly address this logic, so your contribution could help improve performance for similar use cases.

If you need guidance on where to start in the codebase, the relevant files are:

  • api/core/workflow/nodes/parameter_extractor/parameter_extractor_node.py
  • Any workflow or API controller handling input validation and conversation context

Let me know if you need more specific pointers or have questions about the code structure.

To continue talking to Dosu, mention @dosu-bot.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot[bot] commented on GitHub (May 21, 2025): <!-- Answer --> Your suggestion—to only require input validation (such as the is_test parameter) when new inputs are provided, and otherwise use the existing conversation context when conversation_id is present—aligns with best practices for efficient session management. However, based on the available code and documentation, there is currently no explicit logic in Dify that implements this conditional behavior. The ParameterExtractorNode is responsible for extracting and validating parameters, but there is no documentation or code comment explaining why is_test is always required, even when conversation_id is present and inputs have not changed. The current implementation appears to enforce is_test as a required parameter for every request, regardless of whether conversation_id is provided or not. This can lead to unnecessary repeated parameter queries and slower response times, as you've described. Recent changes in the repository (such as new tables and indexes for conversation variables) do not address this specific requirement either [[source]](https://github.com/langgenius/dify/blob/main/api/core/workflow/nodes/parameter_extractor/parameter_extractor_node.py). If you are interested in contributing a solution, you may want to focus on the logic in the ParameterExtractorNode and related workflow execution code. The goal would be to adjust the validation so that: - If conversation_id is present and no new inputs are provided, the system should reuse the previous parameters without requiring is_test. - If new inputs are provided, they should replace the original parameter values as you suggested. There are no existing issues or discussions in the repository that directly address this logic, so your contribution could help improve performance for similar use cases. If you need guidance on where to start in the codebase, the relevant files are: - `api/core/workflow/nodes/parameter_extractor/parameter_extractor_node.py` - Any workflow or API controller handling input validation and conversation context Let me know if you need more specific pointers or have questions about the code structure. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://go.dosu.dev/dosubot), mention @dosu-bot.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/7b525809-6c82-4e88-88d5-c6b6a792e07e?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/7b525809-6c82-4e88-88d5-c6b6a792e07e?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/7b525809-6c82-4e88-88d5-c6b6a792e07e?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/7b525809-6c82-4e88-88d5-c6b6a792e07e?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/7b525809-6c82-4e88-88d5-c6b6a792e07e?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/7b525809-6c82-4e88-88d5-c6b6a792e07e?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/7b525809-6c82-4e88-88d5-c6b6a792e07e?feedback_type=other)</sup>
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#14077