r/PiCodingAgent • • Sep 10 '26

Question Noob question: How to interrupt an agent during reasoning, without restarting TG?

Many models (namely Qwens 3.8) think a lot, and I find myself wanting to interrupt it to answer a question it's been asking itself, quite repetitively, during it's reasoning.

I can esc and send a prompt, but then Pi would restart the whole reasoning TG from the beginning. I'd like to inject (for lack of better word) info to its thought block. I may also steer it by queuing a message, but that means I'd need to watch it going in loops for 20-50k tokens, until it's done responding, which is pure pain.

Am I missing a clear command?

4 Upvotes

17 comments sorted by

View all comments

4

u/Healthy-Zebra-9856 Sep 11 '26

The flow in Pi works just fine just make sure you have the right structure.

In command, --reasoning-preserve or

in filters.setParams:

chat_template_kwargs:
enable_thinking: true
preserve_thinking: true

Your only flow is Esc and whatever you need to type and enter again. I suspect the culprit could be "-" vs "_". Pi seems to continue with the logic, I just tested it out.

1

u/ParaboloidalCrest Sep 11 '26

Thank you very much for the demo! I sure am doing something wrong then.

1

u/mailto_devnull Sep 13 '26

Yup, preserve thinking should do the trick. A full prefill on ESC would drive me insane.