[Bug] Sub-agents stuck in infinite loops consuming excessive tokens

Open 💬 6 comments Opened Jun 28, 2026 by yolpsoftware

Bug Description
The main agent repeatedly runs into this "count <invoke..." loop. It became better when I told the agent to just stop when it detects such a loop, so now it can usually recover and continue its work. But now it seems that the sub-agents have started to run into loops as well. Huge amounts of tokens are wasted by sub-agents that run into loops. This is a software bug.

Environment Info

  • Platform: linux
  • Terminal: vscode
  • Version: 2.1.195
  • Feedback ID: 893ea3b2-f94d-4790-a879-8aa68afc9cdd

This runaway sub-agent loop already consumed at least 12% of my weekly Max 20x tokens allowance, i.e. at least $24 (maybe much more), and I cannot continue my task because the agents run into it again. I'm going to open a billing ticket for that too.

View original on GitHub ↗

This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗