issue: /api/chat/completions in streaming mode set "finish_reason": "stop" for reasoning_content chunk #5991

Closed
opened 2025-11-11 16:41:46 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @SuperPat45 on GitHub (Aug 8, 2025).

Check Existing Issues

  • I have searched the existing issues and discussions.
  • I am using the latest version of Open WebUI.

Installation Method

Docker

Open WebUI Version

v0.6.18

Ollama Version (if applicable)

v0.11.4

Operating System

Linux

Browser (if applicable)

No response

Confirmation

  • I have read and followed all instructions in README.md.
  • I am using the latest version of both Open WebUI and Ollama.
  • I have included the browser console logs.
  • I have included the Docker container logs.
  • I have provided every relevant configuration, setting, and environment variable used in my setup.
  • I have clearly listed every relevant configuration, custom setting, environment variable, and command-line option that influences my setup (such as Docker Compose overrides, .env values, browser settings, authentication configurations, etc).
  • I have documented step-by-step reproduction instructions that are precise, sequential, and leave nothing to interpretation. My steps:
  • Start with the initial platform/version/OS and dependencies used,
  • Specify exact install/launch/configure commands,
  • List URLs visited, user input (incl. example values/emails/passwords if needed),
  • Describe all options and toggles enabled or changed,
  • Include any files or environmental changes,
  • Identify the expected and actual result at each stage,
  • Ensure any reasonably skilled user can follow and hit the same issue.

Expected Behavior

"finish_reason" should be null for reasoning_content chunk

Actual Behavior

"finish_reason" is always "stop" for reasoning_content chunk

Steps to Reproduce

Configure the gpt-oss:latest model with ollama
Call the /api/chat/completions API model in streaming mode:

{
  "messages":[{
    "content":"...",
    "role":"user"
  }],
  "model":"gpt-oss:latest",
  "stream":true
}

All reasoning_content chunks have "finish_reason": "stop" instead of "finish_reason": null.
This can break third party applications which relies on this parameter to stop the display.

Logs & Screenshots

data: {"id": "gpt-oss:latest-eba6d37d-3187-421f-a904-5a2f1b633b8f", "created": 1754645524, "model": "gpt-oss:latest", "choices": [{"index": 0, "logprobs": null, "finish_reason": "stop", "delta": {"reasoning_content": "We"}}], "object": "chat.completion.chunk"}
data: {"id": "gpt-oss:latest-e8a0654a-a490-411f-9304-fd060511a906", "created": 1754645524, "model": "gpt-oss:latest", "choices": [{"index": 0, "logprobs": null, "finish_reason": "stop", "delta": {"reasoning_content": " need"}}], "object": "chat.completion.chunk"}
data: {"id": "gpt-oss:latest-4240a398-d121-4da3-9e63-d150700edec4", "created": 1754645524, "model": "gpt-oss:latest", "choices": [{"index": 0, "logprobs": null, "finish_reason": "stop", "delta": {"reasoning_content": " answer"}}], "object": "chat.completion.chunk"}
....

Additional Information

No response

Originally created by @SuperPat45 on GitHub (Aug 8, 2025). ### Check Existing Issues - [x] I have searched the existing issues and discussions. - [x] I am using the latest version of Open WebUI. ### Installation Method Docker ### Open WebUI Version v0.6.18 ### Ollama Version (if applicable) v0.11.4 ### Operating System Linux ### Browser (if applicable) _No response_ ### Confirmation - [x] I have read and followed all instructions in `README.md`. - [x] I am using the latest version of **both** Open WebUI and Ollama. - [x] I have included the browser console logs. - [x] I have included the Docker container logs. - [x] I have **provided every relevant configuration, setting, and environment variable used in my setup.** - [x] I have clearly **listed every relevant configuration, custom setting, environment variable, and command-line option that influences my setup** (such as Docker Compose overrides, .env values, browser settings, authentication configurations, etc). - [x] I have documented **step-by-step reproduction instructions that are precise, sequential, and leave nothing to interpretation**. My steps: - Start with the initial platform/version/OS and dependencies used, - Specify exact install/launch/configure commands, - List URLs visited, user input (incl. example values/emails/passwords if needed), - Describe all options and toggles enabled or changed, - Include any files or environmental changes, - Identify the expected and actual result at each stage, - Ensure any reasonably skilled user can follow and hit the same issue. ### Expected Behavior "finish_reason" should be null for reasoning_content chunk ### Actual Behavior "finish_reason" is always "stop" for reasoning_content chunk ### Steps to Reproduce Configure the gpt-oss:latest model with ollama Call the /api/chat/completions API model in streaming mode: ``` { "messages":[{ "content":"...", "role":"user" }], "model":"gpt-oss:latest", "stream":true } ``` All reasoning_content chunks have "finish_reason": "stop" instead of "finish_reason": null. This can break third party applications which relies on this parameter to stop the display. ### Logs & Screenshots ``` data: {"id": "gpt-oss:latest-eba6d37d-3187-421f-a904-5a2f1b633b8f", "created": 1754645524, "model": "gpt-oss:latest", "choices": [{"index": 0, "logprobs": null, "finish_reason": "stop", "delta": {"reasoning_content": "We"}}], "object": "chat.completion.chunk"} data: {"id": "gpt-oss:latest-e8a0654a-a490-411f-9304-fd060511a906", "created": 1754645524, "model": "gpt-oss:latest", "choices": [{"index": 0, "logprobs": null, "finish_reason": "stop", "delta": {"reasoning_content": " need"}}], "object": "chat.completion.chunk"} data: {"id": "gpt-oss:latest-4240a398-d121-4da3-9e63-d150700edec4", "created": 1754645524, "model": "gpt-oss:latest", "choices": [{"index": 0, "logprobs": null, "finish_reason": "stop", "delta": {"reasoning_content": " answer"}}], "object": "chat.completion.chunk"} .... ``` ### Additional Information _No response_
GiteaMirror added the bug label 2025-11-11 16:41:46 -06:00
Author
Owner

@tjbck commented on GitHub (Aug 8, 2025):

Addressed with f923a85f409123016f86b8853cecf96be637a431!

@tjbck commented on GitHub (Aug 8, 2025): Addressed with f923a85f409123016f86b8853cecf96be637a431!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#5991