[BUG] plugin_daemon fails to parse stream response from OpenAI Compatible model (e.g., Xinference), resulting in empty answer in Dify frontend #19213

Closed
opened 2026-02-21 19:57:04 -05:00 by yindo · 0 comments
Owner

Originally created by @simons19920101 on GitHub (Oct 14, 2025).

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

dify1.8.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

When using Dify 1.8.1 with an OpenAI API-compatible model provider (e.g., Xinference) configured, the model returns an empty result (answer: "") in the Dify application chat interface, although the model itself is loaded correctly. The page shows a timeout of about 20 seconds and calculates token usage (but completion_tokens is 0), indicating the request was sent to the model service, but the final content was not correctly received or displayed by Dify. Detailed investigation confirms the issue lies in the communication between Dify's plugin_daemon component and Xinference.
Steps to Reproduce:
1.Deploy Dify 1.8.1 offline on a CentOS 7.9 server.
2.Deploy Xinference on the same network environment and successfully load the qwen2.5-instruct model.
3.In Dify's backend, add an "OpenAI API-compatible" model provider.
4.Create a new application and select the configured model.
5.In the application frontend, initiate a conversation (e.g., input "Hello").
6.Observe the result: After several seconds, the page displays the elapsed time and token consumption, but the reply content remains blank. In the F12 developer tools Network panel, the answer field in the chat-messages request response is an empty string.

Behavioral Differences:
Prompt Generator: When using the "Prompt Generator" in Dify's workflow, plugin_daemon sends "stream": false requests and receives standard JSON responses, displaying correctly in the frontend.

Image

: When chatting in an application, plugin_daemon sends "stream": true requests and receives SSE responses, but the frontend answer is empty.

✔️ Expected Behavior

When a user initiates a conversation in the Dify frontend, the model should generate a reply normally and display it in the interface. Even if plugin_daemon sends a streaming request, it should correctly handle the SSE stream response from the OpenAI Compatible model service and integrate it into complete text content returned to the frontend.

Actual Behavior

Regardless of the configuration, as long as the connection is to an OpenAI Compatible model service like Xinference, the Dify frontend displays an empty answer.

[Prompt Generator's logs]1.9.txt

[Application Chat's logs]2.1.txt

Originally created by @simons19920101 on GitHub (Oct 14, 2025). ### 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 dify1.8.1 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce When using Dify 1.8.1 with an OpenAI API-compatible model provider (e.g., Xinference) configured, the model returns an empty result (answer: "") in the Dify application chat interface, although the model itself is loaded correctly. The page shows a timeout of about 20 seconds and calculates token usage (but completion_tokens is 0), indicating the request was sent to the model service, but the final content was not correctly received or displayed by Dify. Detailed investigation confirms the issue lies in the communication between Dify's plugin_daemon component and Xinference. Steps to Reproduce: 1.Deploy Dify 1.8.1 offline on a CentOS 7.9 server. 2.Deploy Xinference on the same network environment and successfully load the qwen2.5-instruct model. 3.In Dify's backend, add an "OpenAI API-compatible" model provider. 4.Create a new application and select the configured model. 5.In the application frontend, initiate a conversation (e.g., input "Hello"). 6.Observe the result: After several seconds, the page displays the elapsed time and token consumption, but the reply content remains blank. In the F12 developer tools Network panel, the answer field in the chat-messages request response is an empty string. Behavioral Differences: Prompt Generator: When using the "Prompt Generator" in Dify's workflow, plugin_daemon sends "stream": false requests and receives standard JSON responses, displaying correctly in the frontend. <img width="1295" height="697" alt="Image" src="https://github.com/user-attachments/assets/7868201a-8ae4-429e-bde1-170eb50a5d56" /> : When chatting in an application, plugin_daemon sends "stream": true requests and receives SSE responses, but the frontend answer is empty. ### ✔️ Expected Behavior When a user initiates a conversation in the Dify frontend, the model should generate a reply normally and display it in the interface. Even if plugin_daemon sends a streaming request, it should correctly handle the SSE stream response from the OpenAI Compatible model service and integrate it into complete text content returned to the frontend. ### ❌ Actual Behavior Regardless of the configuration, as long as the connection is to an OpenAI Compatible model service like Xinference, the Dify frontend displays an empty answer. [Prompt Generator's logs][1.9.txt](https://github.com/user-attachments/files/22900336/1.9.txt) [Application Chat's logs][2.1.txt](https://github.com/user-attachments/files/22900340/2.1.txt)
yindo added the 🐞 bug label 2026-02-21 19:57:04 -05:00
yindo closed this issue 2026-02-21 19:57:05 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#19213