response_mode=blocking is ignored in Chatflow API (always returns text/event-stream) #22249

Open
opened 2026-02-21 20:16:18 -05:00 by yindo · 1 comment
Owner

Originally created by @franbarberorecio on GitHub (Feb 18, 2026).

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • 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, otherwise it will be closed.
  • 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.13.0

Cloud or Self Hosted

Self Hosted (Source)

Steps to reproduce

curl -i -X POST <URL>/v1/chat-messages \
  -H "Authorization: Bearer <chatflow API key>" \
  -H "Content-Type: application/json" \
  -d '{
        "inputs": {},
        "query": "Hi there",
        "response_mode": "blocking",
        "user": "test"
      }'

✔️ Expected Behavior

Content-Type: application/json

Actual Behavior

Content-Type: text/event-stream

Image
Originally created by @franbarberorecio on GitHub (Feb 18, 2026). ### Self Checks - [x] I have read the [Contributing Guide](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) and [Language Policy](https://github.com/langgenius/dify/issues/1542). - [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, otherwise it will be closed. - [x] 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.13.0 ### Cloud or Self Hosted Self Hosted (Source) ### Steps to reproduce ```bash curl -i -X POST <URL>/v1/chat-messages \ -H "Authorization: Bearer <chatflow API key>" \ -H "Content-Type: application/json" \ -d '{ "inputs": {}, "query": "Hi there", "response_mode": "blocking", "user": "test" }' ``` ### ✔️ Expected Behavior Content-Type: application/json ### ❌ Actual Behavior Content-Type: text/event-stream <img width="1620" height="353" alt="Image" src="https://github.com/user-attachments/assets/30e24e22-095f-474f-9450-ef6e6bcbbf8e" />
yindo added the 🐞 bug label 2026-02-21 20:16:18 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Feb 18, 2026):

Hi @franbarberorecio! I'm Dosu and I’m helping the dify team.

This is a known bug affecting Dify versions from 1.4.1 through 1.13.0. Several issues report the same behavior where /v1/chat-messages with response_mode=blocking incorrectly returns text/event-stream instead of application/json.

Related reports include:

Interestingly, the code implementation appears correct—Content-Type should be determined by whether the response is a dict (JSON) or Generator (SSE). The bug seems to occur at runtime where the response object is incorrectly being returned as a Generator even when streaming=False.

Workaround: Some users reported success downgrading to Dify 1.4.0, though this isn't ideal for staying current.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

Chat with Dosu Open in Cursor Join Discord Share on X

@dosubot[bot] commented on GitHub (Feb 18, 2026): <!-- Greeting --> Hi @franbarberorecio! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the dify team. <!-- Answer --> This is a **known bug** affecting Dify versions from 1.4.1 through 1.13.0. [Several issues](https://github.com/langgenius/dify/issues/32351) report the same behavior where `/v1/chat-messages` with `response_mode=blocking` incorrectly returns `text/event-stream` instead of `application/json`. Related reports include: - [Issue #32351](https://github.com/langgenius/dify/issues/32351) - Same behavior in 1.13.0 - [Issue #20883](https://github.com/langgenius/dify/issues/20883) - Blocking mode returns only the first token - [Issue #20626](https://github.com/langgenius/dify/issues/20626) - Chatflow blocking mode API errors Interestingly, the [code implementation](https://github.com/langgenius/dify/blob/41a4a57d2e9e7d41fee5658f503bd350e4786c82/api/libs/helper.py#L289-L301) appears correct—Content-Type should be determined by whether the response is a dict (JSON) or Generator (SSE). The bug seems to occur at runtime where the response object is incorrectly being returned as a Generator even when `streaming=False`. **Workaround**: Some users [reported success downgrading to Dify 1.4.0](https://github.com/langgenius/dify/issues/20883), though this isn't ideal for staying current. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/6769863a-b14b-4cf1-8002-e1fc085b11e7?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/6769863a-b14b-4cf1-8002-e1fc085b11e7?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/6769863a-b14b-4cf1-8002-e1fc085b11e7?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/6769863a-b14b-4cf1-8002-e1fc085b11e7?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/6769863a-b14b-4cf1-8002-e1fc085b11e7?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/6769863a-b14b-4cf1-8002-e1fc085b11e7?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/6769863a-b14b-4cf1-8002-e1fc085b11e7?feedback_type=other)</sup> [![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/6088a4f4-073a-43f3-b3d4-4f06fb0c05a0/ask?utm_source=github)&nbsp;[![Open in Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=This%20is%20a%20%2A%2Aknown%20bug%2A%2A%20affecting%20Dify%20versions%20from%201.4.1%20through%201.13.0.%20%5BSeveral%20issues%5D%28https%3A//github.com/langgenius/dify/issues/32351%29%20report%20the%20same%20behavior%20where%20%60/v1/chat-messages%60%20with%20%60response_mode%3Dblocking%60%20incorrectly%20returns%20%60text/event-stream%60%20instead%20of%20%60application/json%60.%0A%0ARelated%20reports%20include%3A%0A-%20%5BIssue%20%2332351%5D%28https%3A//github.com/langgenius/dify/issues/32351%29%20-%20Same%20behavior%20in%201.13.0%0A-%20%5BIssue%20%2320883%5D%28https%3A//github.com/langgenius/dify/issues/20883%29%20-%20Blocking%20mode%20returns%20only%20the%20first%20token%0A-%20%5BIssue%20%2320626%5D%28https%3A//github.com/langgenius/dify/issues/20626%29%20-%20Chatflow%20blocking%20mode%20API%20errors%0A%0AInterestingly%2C%20the%20%5Bcode%20implementation%5D%28https%3A//github.com/langgenius/dify/blob/41a4a57d2e9e7d41fee5658f503bd350e4786c82/api/libs/helper.py%23L289-L301%29%20appears%20correct%E2%80%94Content-Type%20should%20be%20determined%20by%20whether%20the%20response%20is%20a%20dict%20%28JSON%29%20or%20Generator%20%28SSE%29.%20The%20bug%20seems%20to%20occur%20at%20runtime%20where%20the%20response%20object%20is%20incorrectly%20being%20returned%20as%20a%20Generator%20even%20when%20%60streaming%3DFalse%60.%0A%0A%2A%2AWorkaround%2A%2A%3A%20Some%20users%20%5Breported%20success%20downgrading%20to%20Dify%201.4.0%5D%28https%3A//github.com/langgenius/dify/issues/20883%29%2C%20though%20this%20isn%27t%20ideal%20for%20staying%20current.)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify/issues/32391)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#22249