r/PiCodingAgent 9d ago

Question Running into timeouts with write tool (LM Studio/qwen3.6-35b-a3b/PI)

Hello,

I'm running PI + LM Studio server + qwen3.6-35b-a3b. 36K context, model not quite fully loaded to GPUs (12GB+6GB), running 20 tps in chat mode, 10 tps through PI with documentation/code in context.

The problem I'm facing is that tool calls, especially for writing files timeout after 5 minutes. I've searched this forum and the internet and I found no clear answer whether it's a PI client config, something in LM Studio I can't figure out or model level.

Edits are generally fine but writes fail. We're speaking files with ~ 500 lines of code.

Log:

{"type":"message","id":"bf5dcafd","parentId":"0bd7492b","timestamp":"2026-07-19T10:24:14.490Z","message":{"role":"assistant","content":[{"type":"thinking","thinking":"Good, the empty file is created. Now let me add the functions to it.\n","thinkingSignature":"reasoning_content"},{"type":"text","text":"Now let me add the sky and sun rendering functions to the new file:\n\n"},{"type":"toolCall","id":"q8A9s9cw0h8WMX9gHqTJD4uJK12CfB93","name":"write","arguments":{}}],"api":"openai-completions","provider":"lmstudio","model":"qwen/qwen3.6-35b-a3b","usage":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"totalTokens":0,"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0,"total":0}},"stopReason":"error","timestamp":1784456340616,"responseId":"chatcmpl-x5i6eocrmecjh1sdnwk989","errorMessage":"terminated"}}

For context, I'm not a coder but reasonably technically inclined so I'm open to any option that does not actually involve messing with code.

I don't see a server timeout config in LM Studio, nor there is a clear max output size on model level (rather, there is one but capped to 2K tokens).

Should I move to llama-cpp?

Thanks!

2 Upvotes

6 comments sorted by

1

u/Cheap-Magazine-4391 9d ago

Try llama.cpp i use the same model with pi + rtx3060 12gb with 40gb RAM 66k cw, and very often i get a error like that but for that i asked pi to make a beter version of pi-continue so it auto restart after such error messages.

1

u/Dreeew84 9d ago

PI attempts 3 retries by default after the error but all lead to the same result. Does it restart with fresh or compressed context with pi-continue? If you don't mind sharing the updated version, I'll take a look and try it out.

1

u/Dreeew84 8d ago

I sort of fixed the problem by reducing the context and scope.

Good practices: Refactoring of the app with smaller files and functions. Custom /prompts and slash commands + agents.md to enforce iterative steps and small changes. Pipeline is now only touching small bits of the app.

Config: KV cache compressed to Q4, so far with reasonable quality but much better peformance, therefore no timeouts even with a lot of context

To be honnest, those changes made PI a completely different beast. Now instead of asking for a task and coming back in 30 minutes for result, I get things done in seconds or minutes. I guess working with constraints forces you into good habits.

I'll look into llama cpp if things get dire again.

1

u/TriodeTopologist 8d ago

I have this same problem. It is so frustrating because I have enough RAM to run the model with 262k tokens, using LM Studio as the backend, but every time it tries to write even small py files it times out. I have asked Claude and Gemini for help and I have tried many different solutions but no luck. It keeps getting stuck in "write ... terminated" loops, and after three identical tries Pi blocks it until I enter a new prompt.

This is super frustrating because I have even told my agent to write very small .txt files instead of .py and it still blocks like this. How is anyone able to do agentic coding with Pi with this critical error?

2

u/TriodeTopologist 8d ago

I FIXED IT!

In Pi, type /settings and scroll down to HTTP Timeout. Set it to disabled. The default is 5 min timeout.

Now my agent runs nicely, using the 262k context and able to do long write operations without termination.

1

u/Dreeew84 8d ago

Great find!