[GH-ISSUE #22971] issue: Gemini models stuck in response when using "native" function calling mode with tool-related questions #90597

Open
opened 2026-05-15 15:51:56 -05:00 by GiteaMirror · 21 comments
Owner

Originally created by @silenceroom on GitHub (Mar 24, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/22971

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.8.10

Ollama Version (if applicable)

No response

Operating System

MacOS

Browser (if applicable)

Chrome

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

Gemini models should respond normally to questions that trigger function calling (tools), even in follow-up messages within a session.

Actual Behavior

When using "native" function calling mode:

  • First message - works correctly
  • Second message that triggers function calling (e.g., asking "what time is it now?" which requires a tool) - model gets stuck in responding mode and never completes
  • Second message that does NOT involve function calling - works normally

Steps to Reproduce

  1. Configure a Gemini model (e.g., Gemini-3-Pro or Gemini-3-Flash) with function calling mode set to "native" via official connection.
  2. Start a new chat session
  3. Send a first message - works correctly
  4. Ask a question that requires tool/function calling (e.g., "what time is it now?")
  5. Model response gets stuck in responding mode and never completes

Logs & Screenshots

Gemini stuck in response mode:

Image

Additional Information

  • Function calling mode: "native"
  • Models affected: Gemini-3-Pro, Gemini-3-Flash (possibly other Gemini models)
  • Behavior differs with non-function-call questions: No issue when 2nd question doesn't require tool calling
  • When model gets stuck, all following request will be stuck too even without function call request.
Originally created by @silenceroom on GitHub (Mar 24, 2026). Original GitHub issue: https://github.com/open-webui/open-webui/issues/22971 ### 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.8.10 ### Ollama Version (if applicable) _No response_ ### Operating System MacOS ### Browser (if applicable) Chrome ### 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 Gemini models should respond normally to questions that trigger function calling (tools), even in follow-up messages within a session. ### Actual Behavior When using "native" function calling mode: - First message - works correctly - Second message that triggers function calling (e.g., asking "what time is it now?" which requires a tool) - model gets stuck in responding mode and never completes - Second message that does NOT involve function calling - works normally ### Steps to Reproduce 1. Configure a Gemini model (e.g., Gemini-3-Pro or Gemini-3-Flash) with function calling mode set to "native" via official connection. 2. Start a new chat session 3. Send a first message - works correctly 4. Ask a question that requires tool/function calling (e.g., "what time is it now?") 5. Model response gets stuck in responding mode and never completes ### Logs & Screenshots Gemini stuck in response mode: <img width="1108" height="322" alt="Image" src="https://github.com/user-attachments/assets/96bea980-0b37-4219-be80-6a7f4e7d6829" /> ### Additional Information - Function calling mode: "native" - Models affected: Gemini-3-Pro, Gemini-3-Flash (possibly other Gemini models) - Behavior differs with non-function-call questions: No issue when 2nd question doesn't require tool calling - When model gets stuck, all following request will be stuck too even without function call request.
GiteaMirror added the bug label 2026-05-15 15:51:56 -05:00
Author
Owner

@tjbck commented on GitHub (Mar 24, 2026):

Backend logs? We're unable to assist without any concrete reproduction steps.

<!-- gh-comment-id:4121590381 --> @tjbck commented on GitHub (Mar 24, 2026): Backend logs? We're unable to assist without any concrete reproduction steps.
Author
Owner

@seppel123 commented on GitHub (Mar 25, 2026):

Looks like i have a similar problem but i use OSS-120B.

<!-- gh-comment-id:4127449588 --> @seppel123 commented on GitHub (Mar 25, 2026): Looks like i have a similar problem but i use OSS-120B.
Author
Owner

@soreikomori commented on GitHub (Mar 26, 2026):

I've had this problem for a few months, as described in #19760. Docker logs show essentially nothing:

2026-03-26 22:48:35.613 | INFO     | uvicorn.protocols.http.httptools_impl:send:483 - IP:0 - "POST /api/v1/chats/43f2498b-a310-45a4-bd35-cae84d146db9 HTTP/1.1" 200
2026-03-26 22:48:35.648 | INFO     | uvicorn.protocols.http.httptools_impl:send:483 - IP:0 - "POST /api/chat/completions HTTP/1.1" 200
2026-03-26 22:48:36.913 | INFO     | uvicorn.protocols.http.httptools_impl:send:483 - IP:0 - "POST /api/chat/completed HTTP/1.1" 200
2026-03-26 22:48:36.960 | INFO     | uvicorn.protocols.http.httptools_impl:send:483 - IP:0 - "POST /api/v1/chats/43f2498b-a310-45a4-bd35-cae84d146db9 HTTP/1.1" 200
2026-03-26 22:48:36.986 | INFO     | uvicorn.protocols.http.httptools_impl:send:483 - IP:0 - "GET /api/v1/chats/?page=1 HTTP/1.1" 200

In my particular case, depending on what I set the model up with, I either get an instant "completed" with no content at all- this is the second message in the "completed" response JSON:

{
	"1": {
		"id": "a34efd3b-175e-454e-923e-8c0d9c033a96",
		"role": "assistant",
		"content": "",
		"timestamp": 1774564888
	}
}

Or the eternal loop that @silenceroom described above.

This is the JSON for the "completions" response:

{"status":true,"task_id":"2e9892e6-004d-468e-8279-5b6bf392d586"}

The reproduction steps are pretty much the ones mentioned:

  1. Set up a Google model with the https://generativelanguage.googleapis.com/v1beta/openai URL, Google AI Studio API Key, and OpenAI as provider type. API completions.
  2. Enable native tool calling for any of the resulting models (in my case, gemini-3-flash-preview).
  3. Enable default features for said model and make sure they're functional and enabled (web search, for example).
  4. Make a new chat with said model, and ask a question such as "Give me the latest news for the USA."

That's when it just completes and does nothing else or gets "stuck" thinking- refreshing the page results in the empty response.

<!-- gh-comment-id:4138862777 --> @soreikomori commented on GitHub (Mar 26, 2026): I've had this problem for a few months, as described in #19760. Docker logs show essentially nothing: ``` 2026-03-26 22:48:35.613 | INFO | uvicorn.protocols.http.httptools_impl:send:483 - IP:0 - "POST /api/v1/chats/43f2498b-a310-45a4-bd35-cae84d146db9 HTTP/1.1" 200 2026-03-26 22:48:35.648 | INFO | uvicorn.protocols.http.httptools_impl:send:483 - IP:0 - "POST /api/chat/completions HTTP/1.1" 200 2026-03-26 22:48:36.913 | INFO | uvicorn.protocols.http.httptools_impl:send:483 - IP:0 - "POST /api/chat/completed HTTP/1.1" 200 2026-03-26 22:48:36.960 | INFO | uvicorn.protocols.http.httptools_impl:send:483 - IP:0 - "POST /api/v1/chats/43f2498b-a310-45a4-bd35-cae84d146db9 HTTP/1.1" 200 2026-03-26 22:48:36.986 | INFO | uvicorn.protocols.http.httptools_impl:send:483 - IP:0 - "GET /api/v1/chats/?page=1 HTTP/1.1" 200 ``` In my particular case, depending on what I set the model up with, I either get an instant "completed" with no content at all- this is the second message in the "completed" response JSON: ``` { "1": { "id": "a34efd3b-175e-454e-923e-8c0d9c033a96", "role": "assistant", "content": "", "timestamp": 1774564888 } } ``` Or the eternal loop that @silenceroom described above. This is the JSON for the "completions" response: ``` {"status":true,"task_id":"2e9892e6-004d-468e-8279-5b6bf392d586"} ``` The reproduction steps are pretty much the ones mentioned: 1. Set up a Google model with the `https://generativelanguage.googleapis.com/v1beta/openai` URL, Google AI Studio API Key, and OpenAI as provider type. API completions. 2. Enable native tool calling for any of the resulting models (in my case, gemini-3-flash-preview). 3. Enable default features for said model and make sure they're functional and enabled (web search, for example). 4. Make a new chat with said model, and ask a question such as "Give me the latest news for the USA." That's when it just completes and does nothing else or gets "stuck" thinking- refreshing the page results in the empty response.
Author
Owner

@Global-Citizen commented on GitHub (Mar 27, 2026):

Same problem for a long time. Function calling doesn't work for Gemini models, but it works for others. I raised this issue under #19397, but unlucky.

<!-- gh-comment-id:4141800435 --> @Global-Citizen commented on GitHub (Mar 27, 2026): Same problem for a long time. Function calling doesn't work for Gemini models, but it works for others. I raised this issue under [#19397](https://github.com/open-webui/open-webui/issues/19397), but unlucky.
Author
Owner

@IamGrug commented on GitHub (Mar 27, 2026):

same issue here.

Image
<!-- gh-comment-id:4142477564 --> @IamGrug commented on GitHub (Mar 27, 2026): same issue here. <img width="1229" height="656" alt="Image" src="https://github.com/user-attachments/assets/6c2f7c5a-aa98-4013-9a98-a8eb5fef7a5e" />
Author
Owner

@seppel123 commented on GitHub (Mar 27, 2026):

Its not only Gemini Models, i have it with OSS120B, Anthropic Sonnet 4.6 and GPT 5.1 also.
There are no Errors in the log.

<!-- gh-comment-id:4144049514 --> @seppel123 commented on GitHub (Mar 27, 2026): Its not only Gemini Models, i have it with OSS120B, Anthropic Sonnet 4.6 and GPT 5.1 also. There are no Errors in the log.
Author
Owner

@Classic298 commented on GitHub (Mar 27, 2026):

I too cannot reproduce with any model in multiple different setups. How can i reproduce this?

<!-- gh-comment-id:4144216458 --> @Classic298 commented on GitHub (Mar 27, 2026): I too cannot reproduce with any model in multiple different setups. How can i reproduce this?
Author
Owner

@soreikomori commented on GitHub (Mar 27, 2026):

I too cannot reproduce with any model in multiple different setups. How can i reproduce this?

Did the model answer a prompt just fine? Part of me thinks this could be an API Key issue of some sort... I don't have this problem with GPT, but Gemini (I'm on Paid Tier 1) does indeed just decide to not respond.

<!-- gh-comment-id:4145872863 --> @soreikomori commented on GitHub (Mar 27, 2026): > I too cannot reproduce with any model in multiple different setups. How can i reproduce this? Did the model answer a prompt just fine? Part of me thinks this could be an API Key issue of some sort... I don't have this problem with GPT, but Gemini (I'm on Paid Tier 1) does indeed just decide to not respond.
Author
Owner

@Classic298 commented on GitHub (Mar 27, 2026):

I use all models. Gemini, GPT, Claude, Mistral, various providers, never see anything like this. Always works

<!-- gh-comment-id:4145925280 --> @Classic298 commented on GitHub (Mar 27, 2026): I use all models. Gemini, GPT, Claude, Mistral, various providers, never see anything like this. Always works
Author
Owner

@soreikomori commented on GitHub (Mar 28, 2026):

What tools have you enabled, @Classic298? Have you set them up?

<!-- gh-comment-id:4146054946 --> @soreikomori commented on GitHub (Mar 28, 2026): What tools have you enabled, @Classic298? Have you set them up?
Author
Owner

@soreikomori commented on GitHub (Mar 28, 2026):

Here's the video of what I did and how it keeps, well, not working:

https://github.com/user-attachments/assets/c718f263-7ec7-4968-9b14-b58c5fa086c7

<!-- gh-comment-id:4146129521 --> @soreikomori commented on GitHub (Mar 28, 2026): Here's the video of what I did and how it keeps, well, not working: https://github.com/user-attachments/assets/c718f263-7ec7-4968-9b14-b58c5fa086c7
Author
Owner

@Global-Citizen commented on GitHub (Mar 28, 2026):

Image
Image
Image

Hi @Classic298 , these settings work for GLM or Kimi on OpenRouter, but I’ve never been able to get them to work with Gemini on Google provider.

<!-- gh-comment-id:4146322065 --> @Global-Citizen commented on GitHub (Mar 28, 2026): ![Image](https://github.com/user-attachments/assets/e618400f-369e-4938-b695-2639869f2c27) ![Image](https://github.com/user-attachments/assets/13905469-6886-46cb-beab-6ae1d4b3ab64) ![Image](https://github.com/user-attachments/assets/77234055-5c58-4598-a68d-33e8177a4c08) Hi @Classic298 , these settings work for GLM or Kimi on OpenRouter, but I’ve never been able to get them to work with Gemini on Google provider.
Author
Owner

@seppel123 commented on GitHub (Apr 1, 2026):

Now i figured something out: my problem is that the reply is sometimes sent to the ‘Thoughts’ section. So if nothing appears as output, I can open the ‘Thoughts’ tag and see the reply. I think something is causing issues with closing and opening the tags for the different sections.
This is definitely a bug.

<!-- gh-comment-id:4172059475 --> @seppel123 commented on GitHub (Apr 1, 2026): Now i figured something out: my problem is that the reply is sometimes sent to the ‘Thoughts’ section. So if nothing appears as output, I can open the ‘Thoughts’ tag and see the reply. I think something is causing issues with closing and opening the tags for the different sections. This is definitely a bug.
Author
Owner

@Global-Citizen commented on GitHub (Apr 2, 2026):

Now i figured something out: my problem is that the reply is sometimes sent to the ‘Thoughts’ section. So if nothing appears as output, I can open the ‘Thoughts’ tag and see the reply. I think something is causing issues with closing and opening the tags for the different sections. This is definitely a bug.

Hi @seppel123 , how did you open the ‘Thoughts’ tag?

<!-- gh-comment-id:4173749817 --> @Global-Citizen commented on GitHub (Apr 2, 2026): > Now i figured something out: my problem is that the reply is sometimes sent to the ‘Thoughts’ section. So if nothing appears as output, I can open the ‘Thoughts’ tag and see the reply. I think something is causing issues with closing and opening the tags for the different sections. This is definitely a bug. Hi @seppel123 , how did you open the ‘Thoughts’ tag?
Author
Owner

@seppel123 commented on GitHub (Apr 2, 2026):

Just click on the arrow

Image

I hope they can fix that, its really annoying.

<!-- gh-comment-id:4174956276 --> @seppel123 commented on GitHub (Apr 2, 2026): Just click on the arrow <img width="383" height="105" alt="Image" src="https://github.com/user-attachments/assets/47390e1b-4d3d-4a3a-8f51-3f2e1a53db66" /> I hope they can fix that, its really annoying.
Author
Owner

@Global-Citizen commented on GitHub (Apr 2, 2026):

Just click on the arrow
Image

I hope they can fix that, its really annoying.

Ok, thanks. Looks like my model didn't even start thinking. No 'Thought' section :/

<!-- gh-comment-id:4175049141 --> @Global-Citizen commented on GitHub (Apr 2, 2026): > Just click on the arrow > <img alt="Image" width="383" height="105" src="https://private-user-images.githubusercontent.com/229904247/572905576-47390e1b-4d3d-4a3a-8f51-3f2e1a53db66.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzUxMTIzODUsIm5iZiI6MTc3NTExMjA4NSwicGF0aCI6Ii8yMjk5MDQyNDcvNTcyOTA1NTc2LTQ3MzkwZTFiLTRkM2QtNGEzYS04ZjUxLTNmMmUxYTUzZGI2Ni5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjYwNDAyJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI2MDQwMlQwNjQxMjVaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0wMzE3M2U4YzI5YWI0YjRhYzUxY2I2ODEwMDdlMWM2ZDY2MjMxM2ZkMjJjOGMwNzI3NGU5YTgzNzgyMDI0ZTRhJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.osNESJtp01rnu8RhJ6hCwEXT4QkG9TqvFNikh7i6d6M"> > > I hope they can fix that, its really annoying. Ok, thanks. Looks like my model didn't even start thinking. No 'Thought' section :/
Author
Owner

@seppel123 commented on GitHub (Apr 2, 2026):

Ok i will create a new Issue for that.

<!-- gh-comment-id:4176036326 --> @seppel123 commented on GitHub (Apr 2, 2026): Ok i will create a new Issue for that.
Author
Owner

@ellisd4 commented on GitHub (Apr 3, 2026):

Its not only Gemini Models, i have it with OSS120B, Anthropic Sonnet 4.6 and GPT 5.1 also.
There are no Errors in the log.

I have the same issue with gemma4:31b (via Google API) and gpt-oss:20b (local via ollama).

<!-- gh-comment-id:4185095291 --> @ellisd4 commented on GitHub (Apr 3, 2026): > Its not only Gemini Models, i have it with OSS120B, Anthropic Sonnet 4.6 and GPT 5.1 also. > There are no Errors in the log. I have the same issue with gemma4:31b (via Google API) and gpt-oss:20b (local via ollama).
Author
Owner

@trinhkvo commented on GitHub (Apr 5, 2026):

This has been my issue with gemini api for months. The video posted by soreikomori is exactly my observation when prompting any gemini model to use any tool calling.

<!-- gh-comment-id:4188647203 --> @trinhkvo commented on GitHub (Apr 5, 2026): This has been my issue with gemini api for months. The video posted by [soreikomori](https://github.com/soreikomori) is exactly my observation when prompting any gemini model to use any tool calling.
Author
Owner

@silenceroom commented on GitHub (Apr 10, 2026):

sorry for the late response, super busy in the last few weeks.

With multiple rounds of test, I can reproduce the issue with below conditions:

  1. Gemini works nomral without "built-in" tools enabled.
  2. Once enabled the "build-in" tools, and ask a request that needs to call the tool, the Gemini model then response with blank output.

It looks like the issue was related with the "built-in" tools with Gemini.

<!-- gh-comment-id:4219187854 --> @silenceroom commented on GitHub (Apr 10, 2026): sorry for the late response, super busy in the last few weeks. With multiple rounds of test, I can reproduce the issue with below conditions: 1. Gemini works nomral without "built-in" tools enabled. 2. Once enabled the "build-in" tools, and ask a request that needs to call the tool, the Gemini model then response with blank output. It looks like the issue was related with the "built-in" tools with Gemini.
Author
Owner

@soreikomori commented on GitHub (Apr 21, 2026):

Bug still up on 0.9.1. I should mention that back in the thread when this was first raised (for me at least), @jwhandy3 found a fix, but wasn't able to make a pull request. If anyone can confirm this works in their system, maybe this can be PR'd?

<!-- gh-comment-id:4292125697 --> @soreikomori commented on GitHub (Apr 21, 2026): Bug still up on 0.9.1. I should mention that back in the thread when this was first raised (for me at least), @jwhandy3 found a [fix](https://github.com/open-webui/open-webui/discussions/19760#discussioncomment-15274190), but wasn't able to make a pull request. If anyone can confirm this works in their system, maybe this can be PR'd?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#90597