[GH-ISSUE #15573] Infinity loop in tool calls with Gemma4 + Ollama 0.20.6+ #72001

Open
opened 2026-05-05 03:16:50 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @ByCzech on GitHub (Apr 14, 2026).
Original GitHub issue: https://github.com/ollama/ollama/issues/15573

What is the issue?

Upgrade Ollama to version 0.20.6 (edit and 0.20.7 too) causing infinity loop in tool calls with gemma4:31b. After reverting back to version 0.20.5 this problem will disappear. Observed only with the gemma4 model, other models e.g. qwen3.5 work with tool calls without problems.

Relevant log output


OS

Linux

GPU

AMD

CPU

AMD

Ollama version

0.20.6 / 0.20.7 / 0.21.0

Originally created by @ByCzech on GitHub (Apr 14, 2026). Original GitHub issue: https://github.com/ollama/ollama/issues/15573 ### What is the issue? Upgrade Ollama to version 0.20.6 (edit and 0.20.7 too) causing infinity loop in tool calls with gemma4:31b. After reverting back to version 0.20.5 this problem will disappear. Observed only with the gemma4 model, other models e.g. qwen3.5 work with tool calls without problems. ### Relevant log output ```shell ``` ### OS Linux ### GPU AMD ### CPU AMD ### Ollama version 0.20.6 / 0.20.7 / 0.21.0
GiteaMirror added the bug label 2026-05-05 03:16:50 -05:00
Author
Owner

@PureBlissAK commented on GitHub (Apr 18, 2026):

🤖 Automated Triage & Analysis Report

Issue: #15573
Analyzed: 2026-04-18T18:20:40.963033

Analysis

  • Type: unknown
  • Severity: medium
  • Components: unknown

Implementation Plan

  • Effort: medium
  • Steps:

This issue has been triaged and marked for implementation.

<!-- gh-comment-id:4274306969 --> @PureBlissAK commented on GitHub (Apr 18, 2026): <!-- ollama-issue-orchestrator:v1 issue:15573 --> ## 🤖 Automated Triage & Analysis Report **Issue**: #15573 **Analyzed**: 2026-04-18T18:20:40.963033 ### Analysis - **Type**: unknown - **Severity**: medium - **Components**: unknown ### Implementation Plan - **Effort**: medium - **Steps**: *This issue has been triaged and marked for implementation.*
Author
Owner

@noochboy commented on GitHub (Apr 28, 2026):

Encountering the same issues here.

both with qwen3.5 and gemma4

cloud models are ok

Just tried with qwen3.6:27b as well...

● let's try again... What were we researching? Please check the TASKS.md file and the FIELDS.md file for context
 Let me read those files to get back up to speed.

 <command_bash>
 cat TASKS.md</command_bash>

another test

● can you list the content of file /home/noochboy/.hermes/profiles/researcher/FIELDS.md
 <antThinking>
 The user wants to see the content of a file. I should read it.
 </antThinking>

 <antThinking>
 The user wants to view the content of a specific file. I'll use cat to display it.
 </antThinking>

 bash
 cat /home/noochboy/.hermes/profiles/researcher/FIELDS.md
<!-- gh-comment-id:4333725238 --> @noochboy commented on GitHub (Apr 28, 2026): Encountering the same issues here. both with qwen3.5 and gemma4 cloud models are ok Just tried with qwen3.6:27b as well... <prompt> ● let's try again... What were we researching? Please check the TASKS.md file and the FIELDS.md file for context </prompt> <reply> Let me read those files to get back up to speed. <command_bash> cat TASKS.md</command_bash> </reply> another test <prompt> ● can you list the content of file /home/noochboy/.hermes/profiles/researcher/FIELDS.md </prompt> <reply> <antThinking> The user wants to see the content of a file. I should read it. </antThinking> <antThinking> The user wants to view the content of a specific file. I'll use cat to display it. </antThinking> bash cat /home/noochboy/.hermes/profiles/researcher/FIELDS.md </reply>
Author
Owner

@ByCzech commented on GitHub (May 4, 2026):

Can't confirm that behavior in other model than Gemma4. Other models i.e. Qwen3.x, Mistral etc. works well for me on Vulkan iGPU, GPU and CUDA GPU.

<!-- gh-comment-id:4373882155 --> @ByCzech commented on GitHub (May 4, 2026): Can't confirm that behavior in other model than Gemma4. Other models i.e. Qwen3.x, Mistral etc. works well for me on Vulkan iGPU, GPU and CUDA GPU.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#72001