Qwen3.6-27B model gets stuck in endless tool-call loops

Users running the open-source Qwen3.6-27B model locally are reporting a bug where the model repeatedly calls tools without stopping. For anyone building AI agents on a budget, this is a real pitfall to watch out for.

Qwen3.6-27B is a large open-source language model with 27 billion parameters that you can run on your own computer for free, making it popular for building personal AI agents without paying API fees. However, users have found that when the model is given tools to use — like search, calculators, or external APIs — it can get stuck in a loop, calling the same tool over and over without finishing.

This kind of bug is especially costly in agent pipelines: every repeated call consumes more tokens, which means more compute time or money if you're using a paid service. The community is discussing fixes such as adding a maximum number of steps, tweaking the system prompt, or inserting explicit stop conditions to break the loop before it spirals.

Key points

  • Qwen3.6-27B can get stuck repeatedly calling the same tool without stopping
  • Infinite loops waste tokens and can crash or stall your agent pipeline
  • Always set a max_iterations limit in your agent code as a safety net
  • Prompt adjustments or explicit stop conditions can serve as a temporary fix
  • Test tool-call handling before deploying any agent built on this model

Quick term guide

open-source
Software whose code is shared publicly so others can inspect, use, or change it.
AI agents
AI agents are AI tools that can carry out steps toward a goal, not just answer once.
AI agent
An AI program that can inspect information and suggest what to do next.
parameters
The internal numbers an AI model learns during training; more parameters generally mean a more capable model.
agent pipeline
A sequence of automated steps where an AI model plans, uses tools, and produces results with little human input
pipeline
An automated sequence of steps that processes or moves data without manual intervention.
system prompt
A hidden set of basic instructions that guides how an AI tool behaves.
infinite loops
An error where a program gets stuck doing the exact same thing over and over without stopping.
Read original