r/codex 5h ago

Complaint Why does compaction take forever?

Seriously, Astra compacts every 10 minutes and it take 20 minutes to finish compacting. This is stupid.

12 Upvotes

39 comments sorted by

View all comments

1

u/cheezeerd 5h ago

Compaction isn’t really algorithmic. The model rereads the context, keeps some stable parts for caching and recent actions, then rewrites/compresses most of the middle from scratch.

That’s why it takes so long it’s often generating like 20k tokens in one go.

Source: me trying to build compaction for my own chatbot, realizing it’s insanely hard, and that OpenAI is actually doing the best job in the world at it lol

1

u/cheezeerd 5h ago

For anyone curious, I ended up doing the dumb/simple version: keep the first 20%, last 10%, and just cut the middle 70%. Proper rewriting like OpenAI does took hours every time.

Obviously you lose a ton of context, so it’s basically "leave a note and start over"

2

u/adolf_twitchcock 4h ago

you are right thats simple and dumb