Agent loop - doing the same thing multiple times, even user accept the result

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

I’m testing “qwen/qwen3-30b-a3b-instruct-2507” model via OpenRouter and I’ve observe that agent is geeting into kind of loop.

Steps to Reproduce

  1. Add openrotuer api key and url
  2. Add custom model “qwen/qwen3-30b-a3b-instruct-2507”
  3. Invoke a prompt like “Implement unit tests for …, next run unit tests and check results, if tests are failing, improve them - continue until tests will pass.”
  4. Agent is trying to implement unit tests and partially he is doing that
  5. After little perio of time he’s trying to do same thing even If I will approve the changes

Expected Behavior

Agent should not enter “loop” and doing same thing multiple times - even if user accept the results.

Screenshots / Screen Recordings

Operating System

Linux

Current Cursor Version (Menu → About Cursor → Copy)

Version: 1.7.54
VSCode Version: 1.99.3
Commit: 5c17eb2968a37f66bc6662f48d6356a100b67be0
Date: 2025-10-21T19:07:38.476Z
Electron: 34.5.8
Chromium: 132.0.6834.210
Node.js: 20.19.1
V8: 13.2.152.41-electron.0
OS: Linux x64 6.8.0-86-generic

For AI issues: which model did you use?

qwen/qwen3-30b-a3b-instruct-2507

Does this stop you from using Cursor

Yes - Cursor is unusable

Hey, thanks for the report. This looks like a potential issue with how the Agent handles custom models via OpenRouter, especially with the Qwen family.

I’ve escalated this to the engineering team. A couple of quick questions for debugging:

  • Does the looping happen with Cursor’s built-in models (Claude, GPT‑4, etc.), or only with the custom Qwen model?
  • Have you tried other OpenRouter models to see if they show similar behavior?

There’s a related report about third‑party API models having trouble with tool calling, which suggests broader compatibility issues with non‑native model integrations.

Hi,

I was testing “z-ai/glm-4.6” and “mistralai/devstral-small-2505” seems to be ok.

Build in models also works fine.

Hey,

well, I’ve change a model to latest one: “qwen/qwen3-coder-30b-a3b-instruct” and everything is working fine and pretty good!

I don’t know, maybe that model above is the older version and has some problems.

@deanrie I think ticket can be closed, change model to latest one solve the issue.

Thanks!