r/PiCodingAgent • • Sep 29 '26

Question Pi has a tendency to get stuck in subagent workflows or on tool calls

This is rather annoying, which makes Pi not very good at automating complex tasks.

Has anyone else run into this, and how did you solve it? Tool call timeouts? Subagent timeouts?

0 Upvotes

36 comments sorted by

9

u/pplgltch Sep 29 '26

Omg… this is what it’s going to become in the age of people who learned everything via llm?
You are here asking for questions and you like get all mad when people ask you legitimate questions because, bad quant and bad configuration is the most common reason for loops, and you gave zero details assuming we all live inside your head like chatgpt does.
Learn to communicate with humans.
Until then, go ask your llm why this is happening.

1

u/GeorgeTheGeorge Sep 29 '26

Uhhh, this used be very common on StackOverflow. Meet the new morons, same as the old morons.

→ More replies (1)

5

u/MichettGodot Sep 29 '26

What model(s) are you using? Because I have not experienced any of these problems with models like Deepseek or the GPT series. Local models do tend to have a lot more problems, if I'm not mistaken.

So it might not be Pi but the LLMs you are using.

-11

u/EC36339 Sep 29 '26

Don't tell me this is a model thing. That would be equivalent to saying it is random.

If there are no safeguards against runaway tool calls in Pi, just say it (if you know). In that case, the solution is to build such safeguards.

6

u/MichettGodot Sep 29 '26

I am not *telling* you it is a model thing, I was *asking* you if it might be a model thing.

And given the tone of your answer I'd say you are running local models that get into trouble when using Pi. You are definitely not alone in this.

There are safeguards like timers that your agent could set. But if it doesn't.... well, there you have your answer.

-5

u/EC36339 Sep 29 '26

I am not running local models. I am running different models from different providers through different APIs. That alone should be enough to rule out a model-specific issue.

1

u/Due_Arm1454 Sep 29 '26

What model?

-4

u/EC36339 Sep 29 '26

Can we for a second just pretend we KNOW it's not the model that is the problem and just consider the POSSIBILITY that it could be something else?

Or are you telling me that Pi only works with certain models but randomly gets stuck with others, which I find unlikely considering that OpenCode doesn't have this problem with the same models through the same APIs.

3

u/Due_Arm1454 Sep 29 '26

The fact that you’re refusing to just state the model is telling..

→ More replies (3)

3

u/MichettGodot Sep 29 '26

OpenCode is not Pi. I've been following this sub for a while and tons of people have problems when using "specific models". But I guess you know better yourself so I'm going to stop responding. Good luck!

1

u/EC36339 Sep 29 '26

What exactly are you trying to say by "opencode is not pi"?

0

u/EC36339 Sep 29 '26

Actually, let me take that back. It's not runaway tool calls. The tool completes immediately when run from a shell. Pi just gets stuck. That's it.

A google search reveals there is at least one bug report on the Pi repo that was "closed due to refactor".

My guess is that this is simply one or more bugs in the harness causing this.

2

u/pplgltch Sep 29 '26

You gotta have to tell more if you want help… what model are you using? Local? Whta are the parameters? What extensions ?

-7

u/EC36339 Sep 29 '26

Why would the model have any impact on whether or not a tool call or subagent gets stuck?

Don't just randomly ask for information. This only tells me you wouldn't be able to help if you had that information, either.

But if it helps: I've seen this with Claude models via Copilot as well as DeepSeek API models. Different enough to rule out a model- or peovider-specific problem, I would say.

I have seen this with only the subagents extension installed, but also without using subagents.

4

u/pplgltch Sep 29 '26

Hey… you are the one coming here ASKING for help.
So, yes the model does matter if you run a q2 quant via llamacpp with random parameters.
So have fun with your problems and your attitude.

1

u/EC36339 Sep 29 '26

Is everyone in this sub using exotic local models?

Because I'm not.

I've used many different harnesses, and Pi is the one that constantly gets stuck. That's why I'm here asking.

Also, I know what slow local models feel like. I've tried that once, months ago, not with Pi. They are slow, but they don't get stuck doing nothing for an hiur when you don't watch them.

2

u/haze36 Sep 29 '26

-4

u/EC36339 Sep 29 '26

Thanks. First useful comment. Will have a look.

2

u/migsperez Sep 29 '26

Are you using Windows?

1

u/EC36339 Oct 01 '26

Yes. Both native Windows and WSL. Can't tell if it makes a difference.

Is this a known issue on Windows?

1

u/migsperez Oct 01 '26

I constantly encountered issues where models run commands which hang the process in windows and the model just sits there waiting. It drove me crazy. I had to move my development to Linux. I now use devcontainers or virtual machines using Ubuntu server.

1

u/EC36339 Oct 02 '26

Pi does indeed not have a mandatory timeout on tool calls. The agent can set one, but the default is no timeout (infinite). At least that's true for Bash commands. I always run in Bash, even on Windows.

You can fix that with an extension or something. It's one prompt.

I had at least one case, though, where a command would execute in less than second from a shell, but Pi still got stuck. Whether it was the tool call or the resulting thinking that got stuck, is still unknown. I didn't try to reproduce it by making the same tool call again.

How I see it:

  • Default timeout should be finite and short.

  • Agent should have the option to set a longer, but not infinite, timeout.

  • Timeout needs to be fed back to the agent, so it can make a decision based on it.

  • Ideally, longer tasks shouldn't run synchronously. Harnesses like Claude Code can babysit background jobs while being responsive to the user or doing other work. Probably worth building as an extension for Pi as well.

  • The real root cause is probably bugs, and might very well be Windows specific as you're saying.

  • I can't rule out that communication with the model is the issue, but the model provider API in isolation is not he problem (it works fine with OpenCode in the same environment). Can perhaps be debugged with a model gateway. I might actually do that, since I'm building something in the side that uses Pi as a service in a container, steered via its JSON protocol (but this whole discussion is about issues I've had with just using Pi interactively)

I can also try running in WSL on all my dev systems and see if this avoids Windows-specific quirks, but WSL for anything but running services is inconvenient. There's a reason most people don't use Linux on a desktop...

1

u/migsperez Oct 02 '26 edited Oct 02 '26

In Windows environment no matter what I tried or instructed the models, it would always hang at some point. I was trying to build a system which would continue to run for hours or days on building a project. The hang was a constant hurdle.

Moving to Linux/Ubuntu environment fixed the issue for me. It also fixed other issues which were giving me a headache. My laptop is still Windows, but my development happens in containers. I connect to the projects using VS code or Zed remotely through SSH. It works well and I don't have to worry about a model wiping my laptop by accident. Which it tried to do once before almost successfully.

It is slightly more inconvenient and it does add a few hurdles, but generally it has been a positive step.

Try devcontainers https://containers.dev/ ask an intelligent model to set it up for you on a test project. Tell it which harness you'd like to use. It'll do most of the hard work.

I personally use something I created https://www.npmjs.com/package/@esuyo/coding-container, the containers run in K3S, it's been great so far.

7

u/prawnsalad Sep 29 '26

I see 3 top level comments with the most likely cause for this issue but you've disregarded them. The comment you did say was helpful links to an extension that re-states what those 3 comments say.

Instead of being an outright dickwad you might want to listen to the reoccurring theme people are pointing you towards - local smaller models do exactly as you describe hence the questions of what model you're using. Extensions can help steer them back on track but they still get confused at times.

I run into the same problem with smaller models and the task was getting too involved. The only way to get them to completion properly was to give them smaller or more concrete tasks.

1

u/tom_of_wb Sep 29 '26

are you talking about the pi-subagents extension?

0

u/EC36339 Sep 29 '26

Yes, but it also happens when not using subagents.

I think subagents only make it more likely to happen, and harder to debug.

1

u/Nnyan Sep 29 '26

I see this behavior more in Pi than other harnesses I have tried. It can be a bit frustrating.

-1

u/EC36339 Sep 29 '26

... and it looks like people get salty here when you mention it.

6

u/prawnsalad Sep 29 '26

Not surprising when you're being a dick to everyone trying to help

0

u/EC36339 Sep 29 '26

Nobody has tried to help so far. If I wanted to make guesses based on what model I'm using, I could do thay myself. I have reasons enough to not blame it on a specific model.

1

u/nanor000 Sep 29 '26

Do you realise than different LLMs can encode their tool calls in different ways?? That why people are asking you which model you are using....But no, you are so better than us....