u/polypancake

Why is compaction still a default in opencode? Also why did they remove todowrite?

For the first item, I am just curious since compaction is lossy. I ended up adapting a custom plugin where an agent autonomously checkpoints at a major milestone completion, writes to a memory and also updates a todo list which survives context clearing, then clears the context, then loads the external memory file directly instead of wasting time and tokens compacting the entire conversation. I don't have any extensive testing, but this seems to work just as well if not better than regular compaction and I don't have to waste time having my local LLM (or external cloud LLM) load the entire conversation and summarize. Anthropic and others also seem to recommend against using compaction. So why is opencode providing users an inferior context management experience? Why is this not an option that can be changed in opencode? Are there some drawbacks I am not aware of? To me it seems to give all the benefits of compaction without wasting time and tokens. Other annoying thing is that the opencode team seems to have removed todowrite in v2 for some arbitrary reason saying it was useless. To be honest I still found it useful to know what the agent is actually doing and is a good system to keep track of work for both myself and the agent. I am debating to just move to Pi since any issues or PRs just die and are never addressed by the opencode developers, and the migration from V1 to V2 was incredibly painful. I had to rewrite all of my plugins :/.

reddit.com
u/polypancake — 4 days ago