mirror of
https://github.com/langgenius/dify-official-plugins.git
synced 2026-07-21 17:45:23 -04:00
api parameter "response_mode: blocking" not effect on openAI-API-compatible plugin #330
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Gaocarri on GitHub (May 30, 2025).
Self Checks
Dify version
1.1.3
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
We found that all calls to the model by dify were in streaming mode. In fact, we used /v1/workflows/run and added the "response_mode": "blocking" parameter.
To solve my doubts, I ran the OpenAI-API-compatible plugin code locally and added logs. I found that even if the API is set to "blocking", the stream of the _invoke method is still true.
Is this in line with the expected performance? Maybe I misunderstood the meaning of the blocking parameter?
✔️ Expected Behavior
Blocking parameter worked, it can cut down on performance costs.
❌ Actual Behavior
Blocking parameter not worked
@dosubot[bot] commented on GitHub (May 30, 2025):
The response_mode parameter is designed to control whether the response from the model is streamed ("streaming") or returned as a single, blocking result ("blocking"). In the Dify codebase, this is implemented by mapping response_mode to a boolean stream parameter: if response_mode is "streaming", stream is set to true; if "blocking", stream is false. This stream parameter is then passed through the invocation chain and ultimately to the _invoke method of your plugin, which should use it to decide whether to return a generator (for streaming) or a full result (for blocking) reference.
If you are seeing stream always set to true in your _invoke method, even when response_mode is "blocking", this suggests that either the mapping from response_mode to stream is not happening as expected, or your plugin is not correctly interpreting the stream parameter. The Dify core system does not apply any further logic to "blocking" beyond setting stream to false; it is up to the plugin implementation to handle this correctly reference.
Please check that your plugin's _invoke method is using the stream parameter as intended. For "blocking", it should return a full result, not a generator or stream. If your plugin always streams regardless of the stream parameter, that would explain the behavior you're seeing.
There are no known systemic bugs in Dify's handling of response_mode; the most common issue is a mismatch between the plugin's implementation and Dify's expectations for the stream parameter.
To reply, just mention my name @dosu.
How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

@Gaocarri commented on GitHub (Jun 3, 2025):
@crazywoola i think maybe it is dify's bug,dify does not pass the response_mode parameter to the plugin. Could you please move the issue back to langgenius/dify?
@dosubot[bot] commented on GitHub (Aug 19, 2025):
Hi, @Gaocarri. I'm Dosu, and I'm helping the dify-official-plugins team manage their backlog and am marking this issue as stale.
Issue Summary:
"response_mode": "blocking"does not disable streaming as expected with the OpenAI-compatible plugin."response_mode"to a booleanstreamparameter passed to the plugin’s_invokemethod.Next Steps:
Thank you for your understanding and contribution!