[GH-ISSUE #20464] issue: Claude models with Extended Thinking + Native Tool Use via LiteLLM fail #34721

Closed
opened 2026-04-25 08:49:32 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @themw123 on GitHub (Jan 7, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/20464

Check Existing Issues

  • I have searched for any existing and/or related issues.
  • I have searched for any existing and/or related discussions.
  • I have also searched in the CLOSED issues AND CLOSED discussions and found no related items (your issue might already be addressed on the development branch!).
  • I am using the latest version of Open WebUI.

Installation Method

Docker

Open WebUI Version

v0.6.43

Ollama Version (if applicable)

No response

Operating System

Ubuntu 22.04

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

When using Claude models with Extended Thinking enabled and triggering a tool call (e.g., MCP tools like Tavily web search) with Native Function Calling enabled, the tool should execute successfully and return results to the conversation.

This works correctly with other clients connecting to the same LiteLLM proxy:

  • Continue.dev – Works correctly
  • Claude Code – Works correctly

Actual Behavior

OpenWebUI fails with an invalid_request_error when the model attempts to use a tool via Native Function Calling. The API returns a 400 error indicating that the assistant message doesn't start with a required thinking block.

Note: This issue only occurs when "Native Function Calling" is enabled in OpenWebUI settings.

Steps to Reproduce

  1. Set up LiteLLM as a proxy with a Claude model that supports Extended Thinking (e.g., claude-opus-4-5-thinking)
  2. Connect OpenWebUI to the LiteLLM proxy
  3. Enable "Native Function Calling" in OpenWebUI (Admin Settings → Functions → Native Function Calling)
  4. Configure an MCP tool in OpenWebUI (e.g., Tavily web search)
  5. Send a query that triggers tool use (e.g., "Search the web for recent news about X")
  6. Observe the error in OpenWebUI or in LiteLLM

Logs & Screenshots

litellm.ServiceUnavailableError: litellm.MidStreamFallbackError: litellm.InternalServerError: AnthropicException - API error 400: {
  "error": {
    "code": 400,
    "message": "{\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.1.content.0.type: Expected `thinking` or `redacted_thinking`, but found `text`. When `thinking` is enabled, a final `assistant` message must start with a thinking block (preceeding the lastmost set of `tool_use` and `tool_result` blocks). We recommend you include thinking blocks from previous turns. To avoid this requirement, disable `thinking`. Please consult our documentation at https://docs.claude.com/en/docs/build-with-claude/extended-thinking\"},\"request_id\":\"req_vrtx_011CWtdbzKKzhA7L6t655YSL\"}",
    "status": "INVALID_ARGUMENT"
  }
}
. Handle with `litellm.InternalServerError`.. Received Model Group=claude-opus-4-5-thinking
Available Model Group Fallbacks=None Original exception: InternalServerError: litellm.InternalServerError: AnthropicException - API error 400: {
  "error": {
    "code": 400,
    "message": "{\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.1.content.0.type: Expected `thinking` or `redacted_thinking`, but found `text`. When `thinking` is enabled, a final `assistant` message must start with a thinking block (preceeding the lastmost set of `tool_use` and `tool_result` blocks). We recommend you include thinking blocks from previous turns. To avoid this requirement, disable `thinking`. Please consult our documentation at https://docs.claude.com/en/docs/build-with-claude/extended-thinking\"},\"request_id\":\"req_vrtx_011CWtdbzKKzhA7L6t655YSL\"}",
    "status": "INVALID_ARGUMENT"
  }
}
. Handle with `litellm.InternalServerError`.

Additional Information

Originally created by @themw123 on GitHub (Jan 7, 2026). Original GitHub issue: https://github.com/open-webui/open-webui/issues/20464 ### Check Existing Issues - [x] I have searched for any existing and/or related issues. - [x] I have searched for any existing and/or related discussions. - [x] I have also searched in the CLOSED issues AND CLOSED discussions and found no related items (your issue might already be addressed on the development branch!). - [x] I am using the latest version of Open WebUI. ### Installation Method Docker ### Open WebUI Version v0.6.43 ### Ollama Version (if applicable) _No response_ ### Operating System Ubuntu 22.04 ### 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 When using Claude models with Extended Thinking enabled and triggering a tool call (e.g., MCP tools like Tavily web search) with **Native Function Calling** enabled, the tool should execute successfully and return results to the conversation. This works correctly with other clients connecting to the same LiteLLM proxy: - **Continue.dev** – Works correctly - **Claude Code** – Works correctly ### Actual Behavior OpenWebUI fails with an `invalid_request_error` when the model attempts to use a tool via **Native Function Calling**. The API returns a 400 error indicating that the assistant message doesn't start with a required `thinking` block. **Note:** This issue **only occurs when "Native Function Calling" is enabled** in OpenWebUI settings. ### Steps to Reproduce 1. Set up LiteLLM as a proxy with a Claude model that supports Extended Thinking (e.g., `claude-opus-4-5-thinking`) 2. Connect OpenWebUI to the LiteLLM proxy 3. **Enable "Native Function Calling" in OpenWebUI** (Admin Settings → Functions → Native Function Calling) 4. Configure an MCP tool in OpenWebUI (e.g., Tavily web search) 5. Send a query that triggers tool use (e.g., "Search the web for recent news about X") 6. Observe the error in OpenWebUI or in LiteLLM ### Logs & Screenshots ``` litellm.ServiceUnavailableError: litellm.MidStreamFallbackError: litellm.InternalServerError: AnthropicException - API error 400: { "error": { "code": 400, "message": "{\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.1.content.0.type: Expected `thinking` or `redacted_thinking`, but found `text`. When `thinking` is enabled, a final `assistant` message must start with a thinking block (preceeding the lastmost set of `tool_use` and `tool_result` blocks). We recommend you include thinking blocks from previous turns. To avoid this requirement, disable `thinking`. Please consult our documentation at https://docs.claude.com/en/docs/build-with-claude/extended-thinking\"},\"request_id\":\"req_vrtx_011CWtdbzKKzhA7L6t655YSL\"}", "status": "INVALID_ARGUMENT" } } . Handle with `litellm.InternalServerError`.. Received Model Group=claude-opus-4-5-thinking Available Model Group Fallbacks=None Original exception: InternalServerError: litellm.InternalServerError: AnthropicException - API error 400: { "error": { "code": 400, "message": "{\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.1.content.0.type: Expected `thinking` or `redacted_thinking`, but found `text`. When `thinking` is enabled, a final `assistant` message must start with a thinking block (preceeding the lastmost set of `tool_use` and `tool_result` blocks). We recommend you include thinking blocks from previous turns. To avoid this requirement, disable `thinking`. Please consult our documentation at https://docs.claude.com/en/docs/build-with-claude/extended-thinking\"},\"request_id\":\"req_vrtx_011CWtdbzKKzhA7L6t655YSL\"}", "status": "INVALID_ARGUMENT" } } . Handle with `litellm.InternalServerError`. ``` ### Additional Information ### Related Issues - BerriAI/litellm#14194 - BerriAI/litellm#9020 - BerriAI/litellm#15601 - https://github.com/anomalyco/opencode/issues/3077 - https://github.com/crewAIInc/crewAI/issues/2323
GiteaMirror added the bug label 2026-04-25 08:49:32 -05:00
Author
Owner

@owui-terminator[bot] commented on GitHub (Jan 7, 2026):

🔍 Similar Issues Found

I found some existing issues that might be related to this one. Please check if any of these are duplicates or contain helpful solutions:

  1. #19738 issue: Thinking models render responses inside thinking UI when using native tools
    by qq3829596922 • Dec 04, 2025 • bug

💡 Tips:

  • If this is a duplicate, please consider closing this issue and adding any additional details to the existing one
  • If you found a solution in any of these issues, please share it here to help others

This comment was generated automatically by a bot. Please react with a 👍 if this comment was helpful, or a 👎 if it was not.

<!-- gh-comment-id:3720706927 --> @owui-terminator[bot] commented on GitHub (Jan 7, 2026): 🔍 **Similar Issues Found** I found some existing issues that might be related to this one. Please check if any of these are duplicates or contain helpful solutions: 1. [#19738](https://github.com/open-webui/open-webui/issues/19738) **issue: Thinking models render responses inside thinking UI when using native tools** *by qq3829596922 • Dec 04, 2025 • `bug`* --- 💡 **Tips:** - If this is a duplicate, please consider closing this issue and adding any additional details to the existing one - If you found a solution in any of these issues, please share it here to help others *This comment was generated automatically by a bot.* Please react with a 👍 if this comment was helpful, or a 👎 if it was not.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#34721