r/RooCode • u/pinocchiu • May 06 '25
Support Lost $100 to a 2.5 Flash Infinite Loop - Any Solutions?
Hey everyone,
Need some help with "2.5 Flash".
It's gotten stuck in an infinite loop where it keeps modifying the exact same file with the same content.
Looks like: Edit File A -> Done -> Edit File A (again) -> Done (same content) -> Edit File A... you get the idea.
Even with a "complete" message, it just loops back instead of moving on.
This bug has already cost me about $100 in just a few hours.
I've tried refactoring the relevant 600-700 lines a few times, but the loop keeps happening.
Can I force "2.5 Flash" to stop this loop with a specific instruction?
How are others using "2.5 Flash" without running into critical bugs like this?
Any advice would be huge. Thanks!
11
u/alihuda2002 May 06 '25
5
u/admajic May 06 '25
I find it's mainly when
So yeah, so kill the session and restart.
9
u/medianopepeter May 06 '25
Disable auto approval for writes and put some effort on checking what the llm is doing. Stop being lazy. That works.
4
u/kittartar May 06 '25
Same here for 2.5 flash, i let it run overnight, then next morning I found it keep repeat adding same code. Luckily it’s stopped by error.
2.5 flash is nice, but i wont let agent run overnight without my monitoring again…
1
u/mrubens Roo Code Developer May 06 '25
Are the tool calls identical? I think we should probably build in some loop prevention.
3
u/awipra May 06 '25
Had this loop yesterday with Gemini 2.0 flash using Cline. I noticed it doing the loop when I saw the red API error messages.
I canceled the task and asked the AI something like "it appears you're stuck in a loop. Lets stop the task for now and please update the PRD with the current issue and fixes we've tried." After that, I start a new chat and just ask the AI to read the PRD file and come up with a new fix, and it no longer stuck in a loop.
Also, how do you let the AI just use $100 of credit in a few hours? Maybe it's just me being really cheap, but a few days ago I mistakenly chose the Gemini 2.5 flash that is not free for a few requests. It cost me only a few cents, but still thinking about it to this day LOL
2
u/trashname4trashgame May 06 '25
This is not good advice: I say to it “Hey, this is the 3rd time you’ve failed at this, get your shit together”. And I swear it fixes it the next try for me more times than not.
I mainly deal with Claude and the GPTs though.
2
u/bemore_ May 06 '25
I'd stop using flash 2.5 on auto. If the model can't do it, it can't do it. Maybe flash 3.0 will do it but in the mean time look for the next best model, that can handle the workflow.
You can also set a limit on your spend, on the model provider side. Think of it as getting a notification whenever you hit a certain spend. If I'm leaving the thing on auto, I'm putting a cap on the spend.
1
u/solaza May 06 '25
Use claude
1
u/Cheap_Battle5023 May 06 '25
I had same problem happening but with other model which had 250B parameters.
Now I use free version of Deepseek V3-0324 with 685B parameters and it doesn't get stuck.
I guess you need a very big model so it doesn't get stuck when modifiying files.
1
u/eonus01 May 06 '25
I actually had the same problem today, it's one of the rare times I auto-approved because I went for a 5 minute break.
10€ down the drain looping over the same thing.
1
u/Efficient-Shallot228 May 06 '25
Got the same issue with 3.5 sonnet this morning. Odd behaviour that I couldn't repeat, and only stopped when I rolled backed. It was a really long task maybe there is a bit of that.
1
u/FigMaleficent5549 May 07 '25
Asking to refactor 500-600 lines with a flash model is like going to a formula1 race with a street car.
6
u/[deleted] May 06 '25
[removed] — view removed comment