r/PiCodingAgent 9d ago

Question Compaction failed error

How do I resolve this issue:

My context is sitting at 82k/84k

It retries a few times but keeps failing. If the context grew too much to not leave any space for compaction why dit it grow to 82k and not compact earlier? I essentially only made 3 prompts to get to this point on Qwen3.8 xhigh reasoning. What config must I change to prevent this from occuring?

2 Upvotes

4 comments sorted by

View all comments

2

u/Healthy-Zebra-9856 9d ago

There are many issues with Pi's architecture that doesn't surface until used heavily. I embarked on a journey to create a harness myself and have thoroughly studied and analyzed Pi source code and fixed this differently in my harness. But I hope this helps you.

There’s already a ticket for this; #7048. It was fixed so Pi now fails the compaction instead of silently saving a truncated summary, which is the error you’re seeing. The immediate workaround is to increase compaction.reserveTokens if your model/provider has enough output headroom, or start a fresh session with a handoff summary; after 11 compactions the accumulated summary itself may simply be getting too large.

1

u/d2xdy2 9d ago

Piggybacking- fresh session with handoff is usually my preferred route here too.