r/PiCodingAgent • u/ApprehensiveSkin7975 • 23d ago
Plugin protect-context An extension that record down what the agent has been done for future refence and correction
I built this extension in order to solve losing session problem. One of key problem I found is long agent sessions fail in constraints stated early disappear, “done” is claimed without command output, a “quick fix” rewrites unrelated files, decisions get re-litigated, and the same failing command is retried until the context window is exhausted.
Here is what I build, it is free and open source:
install it pi install npm:protect-context
pi official: protect-context pi package
npm: npm link for protect context
github: github link for protect context
You may want to try it and test it out whether this extension can fulfill your needs.
1
u/ApprehensiveSkin7975 18d ago
I updated "verification" process in the MCP, to make verification more robust. If the report says FAIL, follow its fix line. If it says UNTRUSTED, re-run without a pipe or || true before claiming success
1
u/whiterose0000001 23d ago
I have the same thing, but I don’t use an extension for it. I use honcho. It’s a memory layer that does the same thing; it uses an LLM to find conclusions and then stores them in a vector database. The best thing is that it has separate workspace conversations and separate sessions, with the conclusion of each session separate, so you can also see the conclusion
1
u/randomgenericbot 21d ago
Similar problem, different angle (together with compaction):
I've created an extension that lets the agent summarize in between what it has done, audit its summary, and allows for revising / retrieving / retiring of old work.
For me it works great, and I optimized it in a way so it does not throw away your running kv cache, but reuses most of it for the summary, and after. If your extension does not alter compactions, you might give it a try, else I invite you (and your agent) to get inspiration:
https://github.com/LePrau/pi-self-aware-memory
I am running 50+ compaction sessions on 128k context locally with that, two friends of mine also use it and had no complaints yet.