Model output stop #21172

Closed
opened 2026-02-21 20:11:16 -05:00 by yindo · 5 comments
Owner

Originally created by @z942588879 on GitHub (Dec 19, 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

1.11.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Image The agent output finish_reason: stop

✔️ Expected Behavior

success

Actual Behavior

output stop

Originally created by @z942588879 on GitHub (Dec 19, 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 1.11.1 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce <img width="526" height="606" alt="Image" src="https://github.com/user-attachments/assets/281e20a8-cd42-4110-8e56-c1ff6c254699" /> The agent output finish_reason: stop ### ✔️ Expected Behavior success ### ❌ Actual Behavior output stop
yindo added the 🐞 bug label 2026-02-21 20:11:16 -05:00
yindo closed this issue 2026-02-21 20:11:16 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Dec 19, 2025):

In Dify, finish_reason: stop is the standard value when a model completes generation due to a stop sequence or reaching the max_tokens limit—this is expected and does not indicate a failure. The value comes directly from the underlying LLM provider (like OpenAI or Gemini), and Dify does not use success as a finish_reason; instead, workflow status (such as SUCCEEDED) is tracked separately in the workflow event, not in the finish_reason field (source).

If your output is stopping prematurely or is incomplete, common causes include: custom stop sequences or low max_tokens in your model config, prompt misconfiguration (like missing system/user prompts), using a model that doesn’t support text generation, or plugin bugs (especially with streamed output). For plugins like Tongyi/DeepSeek or Ollama, known bugs in streamed output handling can cause this—workarounds include increasing max_tokens, reducing prompt size, or updating/patching the plugin (DeepSeek/Tongyi example, Ollama example).

If you’re seeing incomplete output, check your model and agent configuration for stop sequences and max_tokens, ensure your prompts are complete, and try with a different model or prompt. If you’re using a plugin, make sure you’re on a version without known streaming bugs. If you need more targeted help, sharing your model/provider details and config will help narrow it down.

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 (Dec 19, 2025): <!-- Answer --> In Dify, `finish_reason: stop` is the standard value when a model completes generation due to a stop sequence or reaching the max_tokens limit—this is expected and does not indicate a failure. The value comes directly from the underlying LLM provider (like OpenAI or Gemini), and Dify does not use `success` as a finish_reason; instead, workflow status (such as SUCCEEDED) is tracked separately in the workflow event, not in the finish_reason field ([source](https://github.com/langgenius/dify/blob/d7b8db2afc8a2aac769b1a225465c2328b5469e9/api/core/workflow/nodes/llm/node.py#L108-L979)). If your output is stopping prematurely or is incomplete, common causes include: custom stop sequences or low max_tokens in your model config, prompt misconfiguration (like missing system/user prompts), using a model that doesn’t support text generation, or plugin bugs (especially with streamed output). For plugins like Tongyi/DeepSeek or Ollama, known bugs in streamed output handling can cause this—workarounds include increasing max_tokens, reducing prompt size, or updating/patching the plugin ([DeepSeek/Tongyi example](https://github.com/langgenius/dify-official-plugins/issues/1621), [Ollama example](https://github.com/langgenius/dify-official-plugins/pull/1973)). If you’re seeing incomplete output, check your model and agent configuration for stop sequences and max_tokens, ensure your prompts are complete, and try with a different model or prompt. If you’re using a plugin, make sure you’re on a version without known streaming bugs. If you need more targeted help, sharing your model/provider details and config will help narrow it down. <!-- 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/d59847ba-a790-4548-af30-1f7b00fec846?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/d59847ba-a790-4548-af30-1f7b00fec846?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/d59847ba-a790-4548-af30-1f7b00fec846?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/d59847ba-a790-4548-af30-1f7b00fec846?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/d59847ba-a790-4548-af30-1f7b00fec846?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/d59847ba-a790-4548-af30-1f7b00fec846?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/d59847ba-a790-4548-af30-1f7b00fec846?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=In%20Dify%2C%20%60finish_reason%3A%20stop%60%20is%20the%20standard%20value%20when%20a%20model%20completes%20generation%20due%20to%20a%20stop%20sequence%20or%20reaching%20the%20max_tokens%20limit%E2%80%94this%20is%20expected%20and%20does%20not%20indicate%20a%20failure.%20The%20value%20comes%20directly%20from%20the%20underlying%20LLM%20provider%20%28like%20OpenAI%20or%20Gemini%29%2C%20and%20Dify%20does%20not%20use%20%60success%60%20as%20a%20finish_reason%3B%20instead%2C%20workflow%20status%20%28such%20as%20SUCCEEDED%29%20is%20tracked%20separately%20in%20the%20workflow%20event%2C%20not%20in%20the%20finish_reason%20field%C2%A0%28%5Bsource%5D%28https%3A//github.com/langgenius/dify/blob/d7b8db2afc8a2aac769b1a225465c2328b5469e9/api/core/workflow/nodes/llm/node.py%23L108-L979%29%29.%0A%0AIf%20your%20output%20is%20stopping%20prematurely%20or%20is%20incomplete%2C%20common%20causes%20include%3A%20custom%20stop%20sequences%20or%20low%20max_tokens%20in%20your%20model%20config%2C%20prompt%20misconfiguration%20%28like%20missing%20system/user%20prompts%29%2C%20using%20a%20model%20that%20doesn%E2%80%99t%20support%20text%20generation%2C%20or%20plugin%20bugs%20%28especially%20with%20streamed%20output%29.%20For%20plugins%20like%20Tongyi/DeepSeek%20or%20Ollama%2C%20known%20bugs%20in%20streamed%20output%20handling%20can%20cause%20this%E2%80%94workarounds%20include%20increasing%20max_tokens%2C%20reducing%20prompt%20size%2C%20or%20updating/patching%20the%20plugin%20%28%5BDeepSeek/Tongyi%20example%5D%28https%3A//github.com/langgenius/dify-official-plugins/issues/1621%29%2C%20%5BOllama%20example%5D%28https%3A//github.com/langgenius/dify-official-plugins/pull/1973%29%29.%0A%0AIf%20you%E2%80%99re%20seeing%20incomplete%20output%2C%20check%20your%20model%20and%20agent%20configuration%20for%20stop%20sequences%20and%20max_tokens%2C%20ensure%20your%20prompts%20are%20complete%2C%20and%20try%20with%20a%20different%20model%20or%20prompt.%20If%20you%E2%80%99re%20using%20a%20plugin%2C%20make%20sure%20you%E2%80%99re%20on%20a%20version%20without%20known%20streaming%20bugs.%20If%20you%20need%20more%20targeted%20help%2C%20sharing%20your%20model/provider%20details%20and%20config%20will%20help%20narrow%20it%20down.)&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/29931)
Author
Owner

@z942588879 commented on GitHub (Dec 19, 2025):

@dosu Where can I see the return of the model api? The model has no returns

@z942588879 commented on GitHub (Dec 19, 2025): @dosu Where can I see the return of the model api? The model has no returns
Author
Owner

@dosubot[bot] commented on GitHub (Dec 19, 2025):

You can view the model API return (the model's output, usage, and finish_reason) in Dify's UI by opening the workflow run details and selecting the "RESULT" tab. This panel shows the outputs returned by the model for that workflow run, including the raw text and metadata from the model API response (source).

If you see "no returns" (no output), common causes are: API/network misconfiguration (like using localhost or a private IP in Docker, which Dify's frontend may reject), plugin bugs, or model config issues. Make sure your model API base URL is reachable from inside the Docker container (use your LAN IP or host.docker.internal, not localhost), and check the workflow run's outputs and error fields for clues (source).

If the UI shows no output and no error, check backend logs for model invocation errors or plugin issues. If you need more help, sharing your model/provider details and any error messages will help narrow it down.

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 (Dec 19, 2025): <!-- Answer --> You can view the model API return (the model's output, usage, and finish_reason) in Dify's UI by opening the workflow run details and selecting the "RESULT" tab. This panel shows the outputs returned by the model for that workflow run, including the raw text and metadata from the model API response ([source](https://github.com/langgenius/dify/blob/d7b8db2afc8a2aac769b1a225465c2328b5469e9/web/app/components/workflow/run/index.tsx#L14-L193)). If you see "no returns" (no output), common causes are: API/network misconfiguration (like using localhost or a private IP in Docker, which Dify's frontend may reject), plugin bugs, or model config issues. Make sure your model API base URL is reachable from inside the Docker container (use your LAN IP or host.docker.internal, not localhost), and check the workflow run's outputs and error fields for clues ([source](https://github.com/langgenius/dify-docs/issues/543)). If the UI shows no output and no error, check backend logs for model invocation errors or plugin issues. If you need more help, sharing your model/provider details and any error messages will help narrow it down. <!-- 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/5a535625-9eb5-48ec-a073-39ac1eae40de?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/5a535625-9eb5-48ec-a073-39ac1eae40de?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/5a535625-9eb5-48ec-a073-39ac1eae40de?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/5a535625-9eb5-48ec-a073-39ac1eae40de?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/5a535625-9eb5-48ec-a073-39ac1eae40de?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/5a535625-9eb5-48ec-a073-39ac1eae40de?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/5a535625-9eb5-48ec-a073-39ac1eae40de?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=You%20can%20view%20the%20model%20API%20return%20%28the%20model%27s%20output%2C%20usage%2C%20and%20finish_reason%29%20in%20Dify%27s%20UI%20by%20opening%20the%20workflow%20run%20details%20and%20selecting%20the%20%22RESULT%22%20tab.%20This%20panel%20shows%20the%20outputs%20returned%20by%20the%20model%20for%20that%20workflow%20run%2C%20including%20the%20raw%20text%20and%20metadata%20from%20the%20model%20API%20response%C2%A0%28%5Bsource%5D%28https%3A//github.com/langgenius/dify/blob/d7b8db2afc8a2aac769b1a225465c2328b5469e9/web/app/components/workflow/run/index.tsx%23L14-L193%29%29.%0A%0AIf%20you%20see%20%22no%20returns%22%20%28no%20output%29%2C%20common%20causes%20are%3A%20API/network%20misconfiguration%20%28like%20using%20localhost%20or%20a%20private%20IP%20in%20Docker%2C%20which%20Dify%27s%20frontend%20may%20reject%29%2C%20plugin%20bugs%2C%20or%20model%20config%20issues.%20Make%20sure%20your%20model%20API%20base%20URL%20is%20reachable%20from%20inside%20the%20Docker%20container%20%28use%20your%20LAN%20IP%20or%20host.docker.internal%2C%20not%20localhost%29%2C%20and%20check%20the%20workflow%20run%27s%20outputs%20and%20error%20fields%20for%20clues%C2%A0%28%5Bsource%5D%28https%3A//github.com/langgenius/dify-docs/issues/543%29%29.%0A%0AIf%20the%20UI%20shows%20no%20output%20and%20no%20error%2C%20check%20backend%20logs%20for%20model%20invocation%20errors%20or%20plugin%20issues.%20If%20you%20need%20more%20help%2C%20sharing%20your%20model/provider%20details%20and%20any%20error%20messages%20will%20help%20narrow%20it%20down.)&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/29931)
Author
Owner

@z942588879 commented on GitHub (Dec 19, 2025):

@dosu How to check the backend logs to find model call errors or plugin issues

@z942588879 commented on GitHub (Dec 19, 2025): @dosu How to check the backend logs to find model call errors or plugin issues
Author
Owner

@dosubot[bot] commented on GitHub (Dec 19, 2025):

To check backend logs for model call errors or plugin issues in your self-hosted Dify (Docker) setup:

  • Use these commands to view logs:

    • docker-compose logs api for model/API errors
    • docker-compose logs worker for workflow/background task errors
    • docker-compose logs plugin_daemon for plugin-related errors
  • You can also inspect log files directly inside containers at /app/logs/server.log, or mount this directory to your host for easier access (details).

  • To get more detailed logs, set LOG_LEVEL=DEBUG and ENABLE_REQUEST_LOGGING=True in your .env file, then restart your containers. This will capture detailed request/response and error logs (reference, reference).

  • Look for keywords like ERROR, Traceback, exception, JSONDecodeError, PluginInvokeError, or anything mentioning your model/provider or plugin name.

  • Model call errors usually appear in api or worker logs; plugin errors (like PluginInvokeError or KeyError: choices) are typically in plugin_daemon logs (reference).

If you need help interpreting a specific log entry, feel free to share the error message or snippet.

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 (Dec 19, 2025): <!-- Answer --> To check backend logs for model call errors or plugin issues in your self-hosted Dify (Docker) setup: - Use these commands to view logs: - `docker-compose logs api` for model/API errors - `docker-compose logs worker` for workflow/background task errors - `docker-compose logs plugin_daemon` for plugin-related errors - You can also inspect log files directly inside containers at `/app/logs/server.log`, or mount this directory to your host for easier access ([details](https://github.com/langgenius/dify/blob/2efdb7b887e74f73b7429688e24e1d7ae4625df2/api/extensions/ext_logging.py#L14-L98)). - To get more detailed logs, set `LOG_LEVEL=DEBUG` and `ENABLE_REQUEST_LOGGING=True` in your `.env` file, then restart your containers. This will capture detailed request/response and error logs ([reference](https://github.com/langgenius/dify/issues/25491), [reference](https://github.com/langgenius/dify/discussions/29784)). - Look for keywords like `ERROR`, `Traceback`, `exception`, `JSONDecodeError`, `PluginInvokeError`, or anything mentioning your model/provider or plugin name. - Model call errors usually appear in `api` or `worker` logs; plugin errors (like `PluginInvokeError` or `KeyError: choices`) are typically in `plugin_daemon` logs ([reference](https://github.com/langgenius/dify/issues/17691)). If you need help interpreting a specific log entry, feel free to share the error message or snippet. <!-- 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/4179f5a5-b00e-4cd3-882a-67fc5ddc444b?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/4179f5a5-b00e-4cd3-882a-67fc5ddc444b?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/4179f5a5-b00e-4cd3-882a-67fc5ddc444b?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/4179f5a5-b00e-4cd3-882a-67fc5ddc444b?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/4179f5a5-b00e-4cd3-882a-67fc5ddc444b?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/4179f5a5-b00e-4cd3-882a-67fc5ddc444b?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/4179f5a5-b00e-4cd3-882a-67fc5ddc444b?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=To%20check%20backend%20logs%20for%20model%20call%20errors%20or%20plugin%20issues%20in%20your%20self-hosted%20Dify%20%28Docker%29%20setup%3A%0A%0A-%20Use%20these%20commands%20to%20view%20logs%3A%0A%20%20-%20%60docker-compose%20logs%20api%60%20for%20model/API%20errors%0A%20%20-%20%60docker-compose%20logs%20worker%60%20for%20workflow/background%20task%20errors%0A%20%20-%20%60docker-compose%20logs%20plugin_daemon%60%20for%20plugin-related%20errors%0A%0A-%20You%20can%20also%20inspect%20log%20files%20directly%20inside%20containers%20at%20%60/app/logs/server.log%60%2C%20or%20mount%20this%20directory%20to%20your%20host%20for%20easier%20access%C2%A0%28%5Bdetails%5D%28https%3A//github.com/langgenius/dify/blob/2efdb7b887e74f73b7429688e24e1d7ae4625df2/api/extensions/ext_logging.py%23L14-L98%29%29.%0A%0A-%20To%20get%20more%20detailed%20logs%2C%20set%20%60LOG_LEVEL%3DDEBUG%60%20and%20%60ENABLE_REQUEST_LOGGING%3DTrue%60%20in%20your%20%60.env%60%20file%2C%20then%20restart%20your%20containers.%20This%20will%20capture%20detailed%20request/response%20and%20error%20logs%C2%A0%28%5Breference%5D%28https%3A//github.com/langgenius/dify/issues/25491%29%2C%20%5Breference%5D%28https%3A//github.com/langgenius/dify/discussions/29784%29%29.%0A%0A-%20Look%20for%20keywords%20like%20%60ERROR%60%2C%20%60Traceback%60%2C%20%60exception%60%2C%20%60JSONDecodeError%60%2C%20%60PluginInvokeError%60%2C%20or%20anything%20mentioning%20your%20model/provider%20or%20plugin%20name.%0A%0A-%20Model%20call%20errors%20usually%20appear%20in%20%60api%60%20or%20%60worker%60%20logs%3B%20plugin%20errors%20%28like%20%60PluginInvokeError%60%20or%20%60KeyError%3A%20choices%60%29%20are%20typically%20in%20%60plugin_daemon%60%20logs%C2%A0%28%5Breference%5D%28https%3A//github.com/langgenius/dify/issues/17691%29%29.%0A%0AIf%20you%20need%20help%20interpreting%20a%20specific%20log%20entry%2C%20feel%20free%20to%20share%20the%20error%20message%20or%20snippet.)&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/29931)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#21172