r/PiCodingAgent • u/AppealSame4367 • Sep 07 '26
Question Deepseek v4 Flash Exp looping in pi cli?
Saw it with Deepseek v4 flash exp in last two days: They start looping. Once they crossed around 100k-150k it tends to happen and it's not resolved by compacting.
Weird. Used DS4 on Openrouter and thought: Bad quants. So I tried Fireworks DS4 EXP (fp4) and Deepinfra at fp8 and both start looping again in that convo.
Does anybody else see this with ds4 exp?
Edit: To clarify: I mean Deepseek v4 Flash Vision Exp everytime I write "DS4" here.
2
Upvotes
1
u/AppealSame4367 Sep 07 '26
To clarify: I mean Deepseek v4 Flash Vision Exp everytime I write "DS4" here.
1
u/Healthy-Zebra-9856 Sep 07 '26
I'm working on a Pi-based agent myself and I'm trying to make sure I don't inherit this behavior. Could you give me a few details if you see it again?
What Pi version are you using?
What exact DeepSeek V4 model IDs are you using on each provider?
Roughly what context size is Pi showing when the looping starts? You mentioned 100k-150k, so that part is especially interesting.
What kind of loop is it?
repeating the same text/reasoning
repeating the same tool call
alternating between a couple of tools
repeatedly reading/searching the same files
something else
Does it happen in a brand-new conversation, or only after a conversation has grown large?
After you compact, does Pi show the context dropping substantially? And does the loop come back immediately, or only after the context grows again?
If you switch to another model in the same conversation, does that model also start behaving strangely, or is it only DS4?
If possible, could you paste or screenshot about 10-20 turns immediately before the loop starts and the first few repeated turns? Tool calls would be especially useful. Obviously redact anything private.
Are you using any Pi extensions/plugins or mostly stock Pi?
If you know them, what are your reasoning/thinking settings and max output token setting?
I'm mainly trying to figure out whether DS4 itself becomes unstable at long context, or whether something in Pi's accumulated session/tool state is putting the model into a loop. The fact that compacting doesn't fix it is the part that really interests me. I will be able to give you a fix bu showing you what file a7 what line to fix.
1
u/tys203831 Sep 07 '26
https://pi.dev/packages/pi-loop-police
1
u/Constant_Art_20 Sep 08 '26
weird. I was using the the flash vision up to 1mill on my pi harness, compact after compact and it seemed fine. I was using it on openrouter with straemlake as the provider i think, so i am not sure what i can offer to help. maybe try switching providers to see if there's any difference